Skip to main content
Participating Frequently
May 27, 2013
Question

Duplicate pdfExportPreset

  • May 27, 2013
  • 4 replies
  • 3133 views

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?

This topic has been closed for replies.

4 replies

Community Expert
January 22, 2020

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 )

BarlaeDC
Community Expert
Community Expert
March 13, 2019

HI,

This seems to work without any issues from the Visual Studio Code with ExtendScript debugger added.

Regards

Malcolm

Community Expert
March 12, 2019

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

Inspiring
May 29, 2013

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

enbanatAuthor
Participating Frequently
May 30, 2013

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?

Vamitul
Legend
May 31, 2013

do you have the "#target indesign" directive at the start of the script?