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

Ok a Dialog box

Guest
Feb 17, 2017 Feb 17, 2017

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

TOPICS
Scripting

Views

626

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

People's Champ , Feb 17, 2017 Feb 17, 2017

InDesign ExtendScript API (12.0)

var pst = app.printerPresets.itemByName ( "MyPrinter" );

app.activeDocument.print ( false, pst );

//To be continued

Votes

Translate

Translate
People's Champ ,
Feb 17, 2017 Feb 17, 2017

Copy link to clipboard

Copied

InDesign ExtendScript API (12.0)

var pst = app.printerPresets.itemByName ( "MyPrinter" );

app.activeDocument.print ( false, pst );

//To be continued

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
Guest
Feb 17, 2017 Feb 17, 2017

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

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
Guest
Feb 17, 2017 Feb 17, 2017

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

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
People's Champ ,
Feb 17, 2017 Feb 17, 2017

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

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
Guest
Feb 17, 2017 Feb 17, 2017

Copy link to clipboard

Copied

LATEST

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

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