Skip to main content
Participant
February 12, 2013
Question

how to use applescript photoshop batch

  • February 12, 2013
  • 1 reply
  • 1394 views

Hello, good afternoon.

     I'm trying to make an applescript that will run a batch procedure in photoshop and I don't know how to wirte 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

I think I have two problems. I realized that if I change the instruction as below, it works. So, there's something wrong with the variable Fotos and with the batch options (I tried to read the photoshop applescript ref, but I don't know what's wrong.

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"

 

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

Tks !

This topic has been closed for replies.

1 reply

Inspiring
February 13, 2013

Not using AppleScript so much these days… But CS5 & CS6 look like they have issues with AppleScript's file alias types so feed it strings instead…

Participant
February 13, 2013

Hi Muppet, tks for the help !

     I tried to feed it strings by many ways friend, but I as I told you I'm not an expert and couldn't make it work... So sad ...

     When I run :

batch "13 x 19 + sharpen" from files Fotos  from "My Actions"

In  the results it comes :

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

And it doesn't work, Photoshop opens a dialog informing : There were no source files that could be opened by Photoshop.

When I write the alias list manually it starts the batch command.

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"

In the Applescript Photoshop Ref:


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

AND

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 )

When I try to use the batch options Photoshop it says the batch command is invalid or not supported.

With these informations do you could help me ?

I'm loosing my hopes ...

Tks !