Copy link to clipboard
Copied
Hi Scripters,
Someone could tell me the real interest of this at the beginning of a script:
- #target indesign
- #targetengine main
- redraw = app.scriptPreferences.enableRedraw;
- app.scriptPreferences.enableRedraw = 0; // speeds up script
Thanks in advance!
(^/)
Copy link to clipboard
Copied
The only thing I've come across is that you have to set enableRedraw to true if you want to use ScriptUI progress bars. On Windows, anyway. Otherwise I don't think it does very much.
Peter
Copy link to clipboard
Copied
Hi Peter,
Thanks!
… A comment about the two first lines?
(^/)
Copy link to clipboard
Copied
You mean the #target lines? They're described in the JavaScript Toold Guide, see the Help menu in the ESTK.
P.
Copy link to clipboard
Copied
Got it! p. 235.
So … if I launch the script (as usual) from InDesign "Scripts Panel" to play inside ID, no need!
If I use ESTK UI, I just need to choose the right app in the pop-up!
Right?
(^/)
Copy link to clipboard
Copied
Off the top of my head:
#targetengine "main" -- the default engine -- global variables are lost after a script completed execution
#targetengine "session" / #targetengine "obi" / #targetengine "kas" / etc. -- a persistent scripting engine that does not lose all of your globals and object references between script executions.
Use persistent scripting engine to:
#target
You may target a particular version of an application if you have more than one installed, for example:
#target indesign-4.0-en_us
You can't do without this in inter-application interaction: e.g. get a link in InDesign, resize it in Photoshop, update and set it to 100% in InDesign.
— Kas
Copy link to clipboard
Copied
Interesting explanation! Thanks Kas!