• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Real meaning and utility! …

LEGEND ,
Nov 16, 2016 Nov 16, 2016

Copy link to clipboard

Copied

Hi Scripters,

Someone could tell me the real interest of this at the beginning of a script:

  1. #target indesign 
  2. #targetengine main 
  3. redraw = app.scriptPreferences.enableRedraw; 
  4. app.scriptPreferences.enableRedraw = 0; // speeds up script 

Thanks in advance!

(^/)

TOPICS
Scripting

Views

492

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 16, 2016 Nov 16, 2016

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 16, 2016 Nov 16, 2016

Copy link to clipboard

Copied

Hi Peter,

Thanks!

… A comment about the two first lines?

(^/)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 16, 2016 Nov 16, 2016

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 16, 2016 Nov 16, 2016

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!

Capture d’écran 2016-11-16 à 22.23.04.png

Right?

(^/)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Nov 16, 2016 Nov 16, 2016

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:

  1. make a start up script
  2. non-modal dialog box -- palette
  3. avoid conflict of global variables

#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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 17, 2016 Nov 17, 2016

Copy link to clipboard

Copied

LATEST

Interesting explanation! Thanks Kas! 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines