In that case it will be possible to store those settings with .indd file, and when .jsx script runs - it can check if those setting exists (in .indd document params) - if so - script can run without showing dialogue with parameters, as all necessary parameters stored with indesign file
Asked
Active
Viewed 443 times
0
-
"Without showing the dialog" is actually a bad idea, because once you entered the data you cannot change it anymore! You should still show the dialog, but fill it with (1) default values if no saved settings are found, or (2) with the saved settings. Then the user can simply press "OK" to accept the dialog, or change it when necessary. – Jongware Nov 16 '14 at 10:52
-
it's possible to force script to show dialog with settings, if Shift or Alt key was pressed when script was executed - this gives necessary flexibility, and such scripts can be programmed with eventListeners, as startup scripts and so on... – Oleh Melnyk Nov 19 '14 at 12:38
1 Answers
2
I've stored per document settings like this:
app.activeDocument.insertLabel('myLabel', 'myLabelValue');
and then you can get it back out like this:
var myLabel = app.activeDocument.extractLabel('myLabel');

Anna Forrest
- 1,711
- 14
- 21
-
if someone need more info: http://indisnip.wordpress.com/2010/07/31/saving-script-data-within-document/ – Oleh Melnyk Nov 16 '14 at 13:50
-
Also: https://indisnip.wordpress.com/2010/09/07/storing-custom-data-into-indesign-file-xmp/ – Tobias Kienzler Dec 08 '16 at 08:46