Skip to main content
bwaldie
Known Participant
April 10, 2011
Question

Undefined PDF Presets in Illustrator CS5

  • April 10, 2011
  • 5 replies
  • 9064 views

I'm encountering a problem when attempting to retrieve a list of PDF preset names in both AppleScript and JavaScript. Here are the steps I'm performing:

1) Launch Illustrator

2) Run the following AppleScript:

     tell application "Adobe Illustrator"

          PDF presets

     end tell

or JavaScript:

     app.PDFPresetsList;

When I run the AppleScript, I receive an error: "Adobe Illustrator got an error: an Illustrator error occurred: 1128353350 ('FNAC')" number 1200.  (Sometimes, 'ACVI' is listed instead of 'FNAC'.)

When I run the JavaScript, I receive: "Result: undefined"

If I retrieve Illustrator's properties via AppleScript, I can see that the PDF presets property appears as 'missing value'.

The only workaround I've found is to manually go to Illustrator and choose "Edit > Adobe PDF Presets", and then immediately click "OK" to close the window.  Whatever this does seems to fix the problem, and if I run the scripts again, they produce the correct results until Illustrator is relaunched, at which time the problem begins again.  I'm wondering if anyone else is experiencing this, and if anyone has come up with any other workarounds, preferably one that doesn't require manual work.

Much appreciated.

-Ben

This topic has been closed for replies.

5 replies

Inspiring
February 26, 2018

Do you have a document open while to try to read the presets? From what I recall I had to open a temp document to read Fonts and PDF presets, then close it again without saving.

Participant
February 26, 2018

I just had the same problem. I worked in Illustrator and then edited one PDF preset in InDesign. After that my Apple Script reported the same error! My solution: Restart, open an Illudtrator document, export as PDF with one of my PDF presets - and then my script worked fine again.

Known Participant
February 15, 2017

Any update on this ??

Participant
August 10, 2011

Did you ever find a fix? I'm ecountering the same thing when trying to capture PDFPresetsList in an Extension... only workaround is to open and close the Adobe PDF Presets window.

bwaldie
bwaldieAuthor
Known Participant
August 11, 2011

Never did identify a resolution.  I still haven't reinstalled Illustrator yet, however, to see if that would fix the problem.  And, haven't tested with CS5.5 yet.  Sorry.

-Ben

Larry G. Schneider
Community Expert
Community Expert
August 11, 2011

This works with a fresh restart of AI

#target illustrator

var textFile = File('~/Desktop/PDF Presets List.txt');

var myList = app.pDFPresetsList;

//alert ("PDF Presets List" + myList);

var appText = '';

for (var i = 0; i < myList.length; i++)
     {
          appText += myList + '\r';
     }

textFile.open('e');

textFile.write(appText);

textFile.close();

Or to read it in AI

#target illustrator

var myList = app.pDFPresetsList;

var appText = '';

for (var i = 0; i < myList.length; i++)
     {
          appText += myList + '\r';
     }

var docRef = documents.add();

var textRef = docRef.textFrames.add();
textRef.contents = appText;
textRef.top = 700;
textRef.left = 100;

Jongware
Community Expert
Community Expert
April 10, 2011

Can you explain this part?

bwaldie wrote:

1) Launch Illustrator

2) [...] JavaScript:

     app.PDFPresetsList;

When I run the JavaScript, I receive: "Result: undefined"

Do you mean you actually run a Javascript, containing just this single "command"? "Command", between quotes, because it's not a real command. It's just a property name; and "executing a property name" wouldn't do anything useful; hence, I'm a bit mystified by your insistence something seems to happen.

bwaldie
bwaldieAuthor
Known Participant
April 11, 2011

Yeah.  All I want is to retrieve a list of PDF preset names, via the PDFPresetsList application property.  The problem is that the property's value is always undefined until I manually go to View > Adobe PDF Presets..., and close the window.  The result I mentioned are what I see in the JavaScript console in Adobe's ExtendScript Toolkit.  When I attempt to get the property via AppleScript, I don't get an undefined result, I get an error 1200.  Once I open and close the Adobe PDF Presets window in Illustrator, the property value is retrieved as expected.

Known Participant
April 13, 2011

Here you go:

tell application "Adobe Illustrator"

set presetNames to PDF presets

end tell