This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INDEXMATIC QUERY LIST GENERATION (PROMPT) | |
| // Cf https://indiscripts.com/IndexMatic | |
| TASK | |
| You are tasked with creating a comprehensive IndexMatic query list from a term frequency table extracted from a document that mainly relates to [[TOPIC]]. Your goal is to generate meaningful, user-centric INDEX entries that help readers navigate the document's content effectively, based on words/keywords/strings that actually occur in the document (i.e. those listed below). | |
| INPUT | |
| [[INSERT FREQUENCY TABLE HERE]] | |
| OUTPUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function setFrameHeightsByLineCount( ask,NL,tf,pf,dup,mul,a,t,n,k,L) | |
| //-------------------------------------------------------------------- | |
| // Select one or more textframes (or have the insertion pt in a frame), | |
| // then enter the desired line number. | |
| { | |
| const LN_MIN = 1; | |
| const LN_MAX = 32; | |
| const SZOF = +AutoSizingTypeEnum.OFF; | |
| const FITC = +FitOptions.FRAME_TO_CONTENT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // InDesign script (function) -- DRAFT [230706] | |
| // Cf https://community.adobe.com/t5/indesign-discussions/indesign-script-keep-reference-of-nested-pageitem-in-group-while-duplicating-it/td-p/13917002 | |
| function indexPath(/*PageItem*/child,/*PageItem*/root,/*bool=0*/AS_SPEC, a,t,p,rk,tk,pk,i,o,x,s) | |
| //---------------------------------- | |
| // Assuming that `root` is a parent of `child` in the DOM hierarchy, returns | |
| // a root-to-child path in the form of a `.<collection>[<index>]` sequence, | |
| // each element being introduced by '.', e.g. `.textFrames[1].ovals[2].textFrames[0]` | |
| // The result is then that `child === root.textFrames[1].ovals[2].textFrames[0]` | |
| // --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function testEventsPriority( w,g) | |
| //---------------------------------- | |
| // ScriptUI CS/CC - Modal dialog. | |
| // Illustrates the distinctive priority of USER vs. PROGRAMMATIC events. | |
| { | |
| // Global mousedown/mouseup listener. | |
| const ON_MOUSE = function(ev, t) | |
| { | |
| // this :: Window | |
| if( (ev.target.properties||0).NoEvent ) return; // Used for the [Clear] action. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(/*any*/ev, ff,t,cond,bk,pf,x) | |
| //---------------------------------- | |
| // [This InDesign script CAN be used as a startup script.] | |
| // Prompts a warning if the inside/left slug of the opened document is less than `MIN_SLUG`. | |
| // Targeted event: afterOpen (app listener) | |
| { | |
| const MIN_SLUG = 130; // in mm | |
| const MM = +MeasurementUnits.MILLIMETERS; | |
| if( (ev||0).isValid ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(/*any*/ev, ff,t,cond,s,z) | |
| //---------------------------------- | |
| // [This InDesign script CAN be used as a startup script.] | |
| // Prompts a warning if some UNembedded links exist in the doc; | |
| // the save/saveAs task is then interrupted. | |
| // [FIX230222] Made a confusion on the script purpose: | |
| // now detect UNembedded links! | |
| // Targeted events: beforeSave|beforeSaveAs | |
| { | |
| const EMBD = LinkStatus.LINK_EMBEDDED.toString(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;(function selPlacePDFPage( dt,doc,sel,t,ok,ff) | |
| //---------------------------------- | |
| // Simple interface for changing page in placed PDF. | |
| // (Just select the PDF container and run.) | |
| { | |
| dt = +new Date; | |
| try | |
| { | |
| doc = app.properties.activeDocument; | |
| if( !doc ) throw "No active document."; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // InDesign script (DRAFT.) | |
| //---------------------------------- | |
| // Apply some text conversion routine on consistent | |
| // style ranges *while preserving special characters* | |
| // (anchored objects, tables, footnotes...) | |
| function myConverter(/*str*/text) | |
| //---------------------------------- | |
| // Change a string into something else... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #targetengine 'usernameVariable' | |
| if( 'function' != typeof( $.global.afterOpenHandler ) ) | |
| { | |
| afterOpenHandler = function(/*afterOpenEvent*/ev, doc,dt,str) | |
| //---------------------------------- | |
| { | |
| doc = ev.target; | |
| if( 'Document' != doc.constructor.name ) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Hiding secret keys in listbox | |
| // (ScriptUI CC Only.) | |
| // --- | |
| var dlg = new Window('dialog'); | |
| var lst = dlg.add('group').add('listbox',void 0, | |
| [ | |
| 'item1' + '\0secretKey1', | |
| 'item2' + '\0secretKey2', | |
| 'item3' + '\0secretKey3', | |
| 'item4' + '\0secretKey4', |
NewerOlder