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

Duplicate pdfExportPreset

New Here ,
May 27, 2013 May 27, 2013

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?

TOPICS
Scripting
2.9K
Translate
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
Enthusiast ,
May 29, 2013 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

Translate
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
New Here ,
May 30, 2013 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?

Translate
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
Advisor ,
May 30, 2013 May 30, 2013

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

Translate
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
Mentor ,
May 30, 2013 May 30, 2013

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

Translate
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
New Here ,
May 31, 2013 May 31, 2013

Vamitul, Jump_Over, I understood you correctly? Have you tested and you have this code works in ESTK?

Translate
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
Mentor ,
May 31, 2013 May 31, 2013

Hi,

on my side a new preset is created (inside Adobe user folder)

rgds

Translate
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
New Here ,
May 31, 2013 May 31, 2013

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.

Translate
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
Mentor ,
May 31, 2013 May 31, 2013

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

Translate
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
New Here ,
May 31, 2013 May 31, 2013

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".

Translate
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
Community Expert ,
Mar 12, 2019 Mar 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

Translate
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
Community Expert ,
Mar 13, 2019 Mar 13, 2019

HI,

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

Regards

Malcolm

Translate
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
Community Expert ,
Jan 22, 2020 Jan 22, 2020
LATEST

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 )

Translate
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