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

Undefined PDF Presets in Illustrator CS5

New Here ,
Apr 10, 2011 Apr 10, 2011

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

TOPICS
Scripting
8.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
Adobe
Community Expert ,
Apr 10, 2011 Apr 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.

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 ,
Apr 10, 2011 Apr 10, 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.

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 Beginner ,
Apr 12, 2011 Apr 12, 2011

Here you go:

tell application "Adobe Illustrator"

set presetNames to PDF presets

end tell

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 ,
Apr 12, 2011 Apr 12, 2011

JaisanM wrote:

Here you go:

tell application "Adobe Illustrator"

set presetNames to PDF presets

end tell

Yep, that's the code I'm trying in AppleScript, and it's failing until I manually open the PDF Presets window and close it again.  Appreciate the suggestion, though.

Regards,

-Ben

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 Beginner ,
Apr 12, 2011 Apr 12, 2011

Hmm that is strange.

I just tested that with Mac OS 10.6.6 on CS5 (15.0.1), it works fine...

You may want to relaunch your illustrator and try with the same script again.

JaisanM

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 ,
Apr 12, 2011 Apr 12, 2011

Yeah, I've tried relaunching, and, unfortunately, it presents the same issue.  I've even tried clearing my presets and starting fresh, and that didn't work either, I'm afraid.

I've also had some clients (who I've delivered scripts to) report encountering the same error.  It's weird.  The script works just fine once the PDF presets window is opened and then closed.  But, once I relaunch Illustrator, the problem begins again every time.  If I can't identify a workaround, I may have to resort to some GUI scripting.

Thanks again for your suggestions.

-Ben

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
Guide ,
Apr 13, 2011 Apr 13, 2011

Both Ben's scripts work fine here so I don't think the issue is with either the language or the given syntax but his install… There are no script options within the app that are going to update this list for you…

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 ,
Apr 13, 2011 Apr 13, 2011

Yes, perhaps. Thanks for confirming everything is working on your end.  I will try re-installing to see if it resolves the problem.  Perhaps it has something to do with me having multiple versions of CS on my machine too.

-Ben

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
Guide ,
Apr 13, 2011 Apr 13, 2011

These options are available to the suite and should be located in…

/Library/Application Support/Adobe/Adobe PDF/Settings/YourListOfOptions
You could see if any other app like ID is seeing them OK… It sounds more a machine maintenance issue that script related…

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 ,
Apr 13, 2011 Apr 13, 2011

I did try clearing that folder of options and starting fresh, but it didn't resolve the issue.  I'll check to see how the other apps behave, and will try to reinstall when I get the chance to see if that resolves things.  Thanks again.

-Ben

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 Beginner ,
Aug 10, 2011 Aug 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.

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 ,
Aug 10, 2011 Aug 10, 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

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 ,
Aug 11, 2011 Aug 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;

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 ,
Aug 11, 2011 Aug 11, 2011

Doesn't work for me.  The first time I run it from the ExtendScript Toolkit, I get an error on the line:

var myList = app.pDFPresetsList;

An Illustrator error occurred: 1230390081 ('ACVI')

If I stop it and run it again, I get a different error on the same line.

An Illustrator error occurred: 1128353350 ('FNAC')

This second error continues to occur for subsequent runs.

-Ben

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 ,
Aug 12, 2011 Aug 12, 2011

When I run the script (either from the ESTK or within AI) it gives me a combined list from two different sources. The first is the list of the suite installed joboptions which are located in OS/HD/Library/Application Support/Adobe/Adobe PDF/Settings like this

Screen shot 2011-08-12 at 8.55.10 AM.png

The other joboptions shown are the user defined ones from <your account>/Library/Applicaton Support/Adobe/Adobe PDF/Settings like this

Screen shot 2011-08-12 at 8.58.05 AM.png

and here's the list from running the script from AI

Screen shot 2011-08-12 at 8.59.18 AM.png

I will have to agree with MuppetMark that it is something with your install that is off.

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 ,
Aug 12, 2011 Aug 12, 2011

Yeah, I suspect it's a problem with my install, perhaps due to CS4 and CS5 (and, until recently, CS3) being installed on the same Mac at the same time. Will try to reinstall at some point to see if the problem persists.  Appreciate the input.

Regards,

-Ben

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 ,
Aug 12, 2011 Aug 12, 2011

Delete

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 ,
Aug 12, 2011 Aug 12, 2011

(Double post deleted)

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 ,
Aug 12, 2011 Aug 12, 2011

Will do.  Thanks again, Larry.

-Ben

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
Engaged ,
Aug 12, 2014 Aug 12, 2014

Did anyone ever find a solution to this problem? We're currently updating a bunch of extend scripts for a client who's moving from Illustrator CS4 to CC 2014, and we've just run into this identical problem in CC 2014, both on our systems, and our client's. We never saw this in CS4, BTW.

Thanks for any insight...

--Peter

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 ,
Aug 12, 2014 Aug 12, 2014

app.PDFPresetsList;


works fine here. CS5 on Win7

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
Engaged ,
Aug 12, 2014 Aug 12, 2014

Thanks for that information, Carlos. I should have mentioned that this script will be running on Mac OS X, 10.9 and eventually 10.10.

Just to be clear, it works fine here as well, IF the PDF Presets window (Edit > Adobe PDF Presets...) has been opened and closed at least once after the application was launched, just as originally reported by Ben. It actually doesn't matter if one presses "Cancel" or "OK" to dismiss the window; just that it be opened and closed...

Also as reported, in the ESTK, the property simply does not appear in the Data Browser. In Script Debugger's  data explorer (AppleScript), the error "an Illustrator error occurred: 1128353350 ('FNAC')" is shown.

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 ,
Aug 12, 2014 Aug 12, 2014

I see it in mine

pdfPresetListDataBrowser.PNG

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
Engaged ,
Aug 26, 2014 Aug 26, 2014

CarlosCanto wrote:

I see it in mine

pdfPresetListDataBrowser.PNG

Thanks, Carlos. I gather you are running on Windows? It seems that this may be a Mac-only problem. I've filed a bug report with Adobe...

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