0 Replies Latest reply on Feb 4, 2012 12:00 PM by lithodora

    [AS][CS5] Photoshop script no longer opening PDFs without prompt

    lithodora
      set this_folder to (choose folder with prompt "Pick the folder containing the PDF files to process:" ) as string
      
      tell application "System Events"
          set these_files to every file of folder this_folder
      end tell
      repeat with i from 1 to the count of these_files
          set this_file to (item i of these_files as alias)
          set this_info to info for this_file
          if visible of this_info is true and alias of this_info is false and name extension of this_info is "pdf" then
              set myFilePath to ((this_folder & name of this_info) as string)
              tell application "Adobe Photoshop CS5.1"
                  with timeout of 300 seconds
                      open alias myFilePath as PDF with options {class:PDF open options, mode:CMYK, resolution:300, use antialias:true, page:1} showing dialogs never
                  end timeout
              end tell
          end if
      end repeat
      

       

       

      The above was working when I wrote it.

      The next time I tried to use it it fails to open the PDF.

      What I get:

      Error: 8800. General Photoshop error occurred.
      This functionality may not be availble in this version of Photoshop. - <no additional information available>
      

      Removing the 'showing dialogs never' causes Photoshop to ask me what files to open and how to handle the PDF.

      Changing the tell to say:

       

      tell application "Adobe Acrobat"
      open alias myFilePath
      end tell
      

       

      Opens all the PDFs as I expected it to because the file alias is valid. I have appropriate file access.

       

      set this_folder to (choose folder with prompt "Pick the folder containing the PDF files to process:" ) as string

       

      tell application "System Events"
          set these_files to every file of folder this_folder
      end tell
      repeat with i from 1 to the count of these_files
          set this_file to (item i of these_files as alias)
          set this_info to info for this_file
          if visible of this_info is true and alias of this_info is false and name extension of this_info is "pdf" then
              set myFilePath to alias ((this_folder & name of this_info) as string)
              tell application "Adobe Photoshop CS5.1"
                  with timeout of 300 seconds
                      open  myFilePath as PDF with options {class:PDF open options, mode:CMYK, resolution:300, use antialias:true, page:1} showing dialogs never
                  end timeout
              end tell
          end if
      end repeat
      

      Results in an error:

       

      File some object wasn't found
      

       

      So anyone know what I'm doing wrong?