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
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
...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.
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.
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.
Copy link to clipboard
Copied
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.