6 Replies Latest reply on Jan 18, 2016 11:55 PM by eamcp

    Applescript Save as PDF Error on 10.11

    eamcp

      Hi,

       

      I have an Applescript application that populates an Illustrator PDF with data and colours and then saves the document to the desktop as a PDF, named a certain way.

       

      I have just upgraded to Mac OS 10.11 (El Capitan) and now the script errors on the save command everytime. It has previously worked on versions of Illustrator from CS2 to CC2015 and versions of OS from 10.5 - 10.10

       

      tell application "Adobe Illustrator"

      tell current document

        set PDF_Dest to ((path to desktop folder) as string) & "test.pdf" as text

        save in file (PDF_Dest) as pdf with options {class:PDF save options, preserve editability:true}

        end tell

      end

       

      The error is: an Illustrator error occurred: 1129270854 ('FNOC')

       

      Is this a known bug? - I cannot find any other recent record of this error

      Is there a way around it?

      Could I just replace the command with Javascript? I know very little JS, do you have a code snippet that you can pass the destination file path to?

       

      Thanks for any help

      Ian

        • 1. Re: Applescript Save as PDF Error on 10.11
          joshlac

          Hi, I've the same issue after upgrading to 10.11.

          Did you find any fix for it?

          • 2. Re: Applescript Save as PDF Error on 10.11
            eamcp Level 1

            No, I couldn't fix it. I am not sure if it is something that might be fixed in a future Creative Cloud or OSX update.

            I managed to get a Javascript version of save as, but this had the same issue.

            My workaround was to change the order things happen in the script. Initially, a template was downloaded and then one or more files were populated and saved to separate files on the desktop at the end of the repeat loop.

            Now, at the beginning of the repeat loop, the template PDF is duplicated to the desktop with the correct name, then opened, populated and then I use "close saving yes" to save the file.

            Hope that helps

            • 3. Re: Applescript Save as PDF Error on 10.11
              joshlac Level 1

              Thanks for your reply.

              Guess what, I did fresh install of 10.11.2, Illustrator CS6 and the script works!!!

              The key is to use Java 8 Update 65, do not update do version 66!

              • 4. Re: Applescript Save as PDF Error on 10.11
                eamcp Level 1

                I am glad you have solved why it was happening. I am using Java 8 Update 51 (haven't updated to 10.11.2 yet)

                I will stick with my workaround as the application is used throughout my company and I can't guarantee what Java update has been applied

                Thanks

                • 5. Re: Applescript Save as PDF Error on 10.11
                  steuieg

                  In using the following line:

                   

                     save current document in file outputPathName as pdf with options {class:PDF save options, PDF preset:"some_preset"}

                   

                  in a script I wrote recently to export a PDF version of a specific file after saving the file to a mounted directory, I got the error too:

                  "The error is: an Illustrator error occurred: 1129270854 ('FNOC')"

                   

                  After reading this article I realised that the machine was a fresh rebuild so I checked for the existence of the PDF preset. Lo and behold the preset was not present. After adding the preset to the presets in the export to pdf window the error disappeared.

                   

                  Hope that helps someone!

                  • 6. Re: Applescript Save as PDF Error on 10.11
                    eamcp Level 1

                    FWIW I tried

                     

                    save in file (PDF_Dest) as pdf with options {class:PDF save options, PDF Preset:"[Illustrator Default]"}


                    Which strangely gave intermittent results. The issue is that I have to specify certain preferences like preserve editability and Not viewing after saving. At this point, any deviation from any preset that Illustrator knows about will result in the error and if you manually go to save a PDF, the Preset pre-selected in the drop down will be "Custom". Interestingly, if you ask for a list of PDF Presets in the script, to ensure that you are going to use one that is present, I often got an empty list returned to the script, even though the standard set of Presets were present in the application.

                    This is why I went down the workaround route of creating the target document and then using close and save. Hope there is a fix for it in future, which isn't dependent on an older version of Java.

                    Thanks for your input

                    Ian