0 Replies Latest reply on Feb 13, 2013 7:22 AM by LeleBrasil

    Applescript Photoshop batch

    LeleBrasil

      Hello !

       

           I'm trying to make an applescript that will run a batch procedure in photoshop and I don't know how to write its code. Let me show my script :

       

       

      set pasta_evento to choose folder with prompt "Select folder of the event: "

      set pasta_tratadas to (pasta_evento as string) & "Tratadas:" as alias

       

       

      set arq_log to (pasta_evento as string) & "Log_Erros.txt"

      tell application "Finder"

                if not (exists file arq_log) then

        make new file at pasta_evento with properties {name:"Log_Erros.txt"}

                end if

      end tell

       

      set Fotos to files of pasta_evento as alias list

       

       

      tell application "Adobe Photoshop CS6"

        activate

                                    set display dialogs to never

                                    batch "13 x 19 + sharpen" from files Fotos  from "My Actions" with options {destination:folder, destination folder:pasta_tratadas, error file:alias arq_log}

      end tell

       

       

      When I run it, Photoshop opens a dialog informing : "There were no source files that could be opened by Photoshop".

       

      I realized that if I change the instruction as below, it works. So, there's something wrong with the variable Fotos - I tried to feed it with strings but didn't know how to do it.

       

       

      tell application "Adobe Photoshop CS6"

        activate

                                    set display dialogs to never

                                    batch "13 x 19 + sharpen" from files {"Disk:Users:Me:Pictures:Macros:Tratadas:0002.JPG", "Disk:Users:Me:Pictures:Macros:Tratadas:0025.JPG"} from "My Actions"

       

       

      When I run the same script with the batch, Photoshop says there's something wrong with the batch command. I tried to read the photoshop applescript ref, but I don't know what's wrong.

       

       

      Could anybody help me correct this code ? I'm not definetively an expert!

       

       

      Some refs about batch and batch options :

       

       

       

       

      batchv : run the batch automation routine

       

      batch text : the name of the action to play (note that the case of letters in the Action name is important and must match the case of the name in the Actions palette)

      from files list of alias : list of input files to operate on

      from text : the name of the action set containing the action being played (note that the case of letters in the Action Set name is important and must match the case of the name in the Actions palette)

      [with options batch options] : options for Batch

       

       

       

       

      batch optionsn : options for the Batch command

      properties

      destination (folder/none/save and close) : final destination of processed files ( default: none )

      destination folder (alias) : folder location when using destination to a folder

      error file (alias) : file to log errors encountered, leave this blank to stop for errors

      file naming (list of ddmm/ddmmyy/document name 3/document name lower/document name mixed/extension lower/extension upper/mmdd/mmddyy/serial letter lower/serial letter upper/serial number four/serial number one/serial number three/serial number two/yyddmm/yymmdd/yyyymmdd) : list of file naming options 6 max.

      macintosh compatible (boolean) : make final file name Macintosh compatible ( default: true )

      override open (boolean) : override action open commands ( default: false )

      override save (boolean) : override save as action steps with destination specified here ( default: false )

      startingserial (integer) : starting serial number to use ( default: 1 )

      suppress open (boolean) : suppress file open options dialogs ( default: false )

      suppressprofile (boolean) : suppress color profile warnings ( default: false )

      unix compatible (boolean) : make final file name Unix compatible ( default: true )

      windows compatible (boolean) : make final file name Windows compatible ( default: true )

       

       

       

       

       

      Tks !