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

Selecting text and documents while Script is open?

Advocate ,
Oct 17, 2016 Oct 17, 2016

Copy link to clipboard

Copied

I'm not sure what to search for in the Forum. What i'm wanting is to have my script run like what the Find/Change Window does.  I want to have my script run but still be able to select Text and switch documents etc.. without closing the Script. If theres another script/thread on here please point me to it.  If i am not explaining this correctly please let me know.  THanks guys and gals 

TOPICS
Scripting

Views

359

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

correct answers 1 Correct answer

Engaged , Oct 17, 2016 Oct 17, 2016

Script UI is what you want.

#targetengine "show pages"

with(new Window('palette', 'UI to stay open')){

    orientation = 'row';

    showPageRange = add('button', undefined, 'Show Page Range');

    showPageRange.onClick = function(){alert("1 - " + app.activeDocument.pages.length)}

    show();

}

Create a 'palette' type window with a target engine. This will allow the window to stay open while still being able to edit or change documents.

see CS3 JS: Table of Contents, ScriptUI Classes  and CS3 JS: Window 

...

Votes

Translate

Translate
Enthusiast ,
Oct 17, 2016 Oct 17, 2016

Copy link to clipboard

Copied

You will want to investigate Adobe Script UI. If a Mac user you may want to learn Objective C for AppleScript (AppleScriptObjC). On the Mac you also have Automator that can cobble a bunch of tools and code together to do what you want. Of course there is VisualBasic for Windows, and more. You just need some way to communicate with InDesign with a non-modal dialog (modal dialogs take over the UI until they are closed).

Hope this helps.

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
Advocate ,
Oct 17, 2016 Oct 17, 2016

Copy link to clipboard

Copied

Thank you for your reply.  I was hoping javascript was able to handle it. The down side to Apple script is that it will not work on Windows PC.  The scripts i'm building need to be for both so that way our windows users will have the same functionality as the Mac. 

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
Engaged ,
Oct 17, 2016 Oct 17, 2016

Copy link to clipboard

Copied

Script UI is what you want.

#targetengine "show pages"

with(new Window('palette', 'UI to stay open')){

    orientation = 'row';

    showPageRange = add('button', undefined, 'Show Page Range');

    showPageRange.onClick = function(){alert("1 - " + app.activeDocument.pages.length)}

    show();

}

Create a 'palette' type window with a target engine. This will allow the window to stay open while still being able to edit or change documents.

see CS3 JS: Table of Contents, ScriptUI Classes  and CS3 JS: Window  for more information on Script UI.

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
Advocate ,
Oct 18, 2016 Oct 18, 2016

Copy link to clipboard

Copied

LATEST

Thank you.  HOpefully i can get this to work with my code.  the Dialog is tied into everything. I'll mess around and let you guys know.  For now I'm going to mark this as correct because this does do what i asked for.  I'm just not sure how easy it will be to add to my code.

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