Duplicate pdfExportPreset
Copy link to clipboard
Copied
This script:
app.pdfExportPresets[0].duplicate().bleedMarks = true;
Works correctly when run from a pallet Sctipts (new preset created)
and does NOT work if you run it from the editor ExtendScript Toolkit.
Why?
Copy link to clipboard
Copied
Not sure exactly, but when you're duplicating an export preset, you're also duplicating a .joboptions file on disk—a file which many applications share access to. I've had trouble predictably scripting them.
You can set your prefs on the fly before export, without duplicating presets, with something like:
var prefs = app.pdfExportPresets.item('[High Quality Print]').properties;
prefs.bleedMarks = true;
app.pdfExportPreferences.properties = prefs;
Jeff
Copy link to clipboard
Copied
Thank you. These options may be many. For example, i can use the persets that are available, or eliminate scripting 😃
From Scripts pallete my code work like a charm. Why is causing the error on ESTK?
Copy link to clipboard
Copied
do you have the "#target indesign" directive at the start of the script?
Copy link to clipboard
Copied
enbanat wrote:
...From Scripts pallete my code work like a charm. Why is causing the error on ESTK?
This reason may be many as well.
Did you choose InDesign as a target (pop-up) runing script from ESTK?
Can you see any error?
Jarek
Copy link to clipboard
Copied
Vamitul, Jump_Over, I understood you correctly? Have you tested and you have this code works in ESTK?
Copy link to clipboard
Copied
Hi,
on my side a new preset is created (inside Adobe user folder)
rgds
Copy link to clipboard
Copied
Jump_Over, thank you, it's strange result. I tested in two different comps and have this error: "The requested action could not be completed because the object no longer exists.".
Mac OS X 10.7, CS5.5 and CS6.
Copy link to clipboard
Copied
Hi,
I think it happens when your preset is taken from app folder and has not its "same_named" copy in user folder.
Try copy some preset from app to your user folder Adobe PDF:Settings and re-run.
It is some weird behaviour, cause default folder for preset.duplicate() is user folder and InDesign looks like lost a path while proceeding this.
rgds
Copy link to clipboard
Copied
I tried to duplicate the preset file. But this preset does not work at all in any way.
pepFile = app.pdfExportPresets[0].fullName;
pepFile.copy(pepFile.parent.fsName + '/newPep.joboptions');
pdfExportPreset = app.pdfExportPresets.itemByName('newPep');
pdfExportPreset.bleedMarks = true; // error: "Object is invalid"
File newPep.joboptions successfully created. Last srting generate error "Object is invalid".
Copy link to clipboard
Copied
enbanat wrote
This script:
app.pdfExportPresets[0].duplicate().bleedMarks = true;
Works correctly when run from a pallet Sctipts (new preset created)
and does NOT work if you run it from the editor ExtendScript Toolkit.
Why?
An old thread I have to revive…
I see the same behavior testing with InDesign CC 2019 version 14.0.1.209 and the ESTK.
If the script is executed from InDesign's Scripts Panel no issue at all.
The duplicate of the pdfExportPreset is used and the PDF file is written.
I have no answer why the ESTK is throwing an error if I want to access the duplicated preset: "Object does not exist anymore".
Regards,
Uwe
Copy link to clipboard
Copied
HI,
This seems to work without any issues from the Visual Studio Code with ExtendScript debugger added.
Regards
Malcolm
Copy link to clipboard
Copied
Hi Malcom,
tested the ESTK under Windows 10 with my German InDesign 2020 now.
The issue persists. Same code is running without flaw when executed from Scripts Panel of InDesign.
Regards,
Uwe Laubender
( ACP )

