Copy link to clipboard
Copied
There is bound to be a clever person out there that has the answer to this one!
More out of interest than necessity, but curiosity has gotten the best of me and I wondered if it's possible .
You know your default settings of the print dialog box are exactly what you want and you want to print your page part way through your script, is it possible to OK the print dialog box and then the script continues without any manual intervention?
app.menuActions.itemByName("$ID/Print...").invoke() \\ Open Print Dialog Box
Hope someone can help, Bren
InDesign ExtendScript API (12.0)
var pst = app.printerPresets.itemByName ( "MyPrinter" );
app.activeDocument.print ( false, pst );
//To be continued
Copy link to clipboard
Copied
InDesign ExtendScript API (12.0)
var pst = app.printerPresets.itemByName ( "MyPrinter" );
app.activeDocument.print ( false, pst );
//To be continued
Copy link to clipboard
Copied
Thanks Loic!
I keep looking at the "InDesign ExtendScript API" and it blows my mind, I can usually change parts of a script line to work when I have the whole line but find it hard to build from scratch.
That's fantastic though, Thank You
Copy link to clipboard
Copied
Just to further that conversation, would you or anyone else know if there is a command that would 'virtually press' the default or cancel button on any open Dialog box?
Just thinking of things like the DataMerge dialog that doesn't have Presets to run with?
Thanks, Brendan
Copy link to clipboard
Copied
Well generally you would do everything but dealing with user interactions such as clicking on a button via script.
99,99 of InDesign is scriptable so it's likely you don't have to worry of shown dialogs.
I mean "clicking" cancel is basically not running your routine.
But in the extreme scenario, you can use system events on mac. Don't know the alternative on PC
AppleScript Programming/System Events - Wikibooks, open books for an open world
Loic
Copy link to clipboard
Copied
Thanks Loic,
Understood, as you say most of the time you wouldn't need it anyway and it's more inquisitive than required, I am on a Mac so will will have a look at the system events page and see what results I can get.
Thank you, Bren