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 :
setpasta_eventotochoose folderwith prompt "Select folder of the event: "
setpasta_tratadasto (pasta_eventoasstring) & "Tratadas:" asalias
setarq_logto (pasta_eventoasstring) & "Log_Erros.txt"
tellapplication "Finder"
ifnot (existsfilearq_log) then
makenewfileatpasta_eventowith properties {name:"Log_Erros.txt"}
endif
endtell
setFotostofilesofpasta_eventoasalias list
tellapplication "Adobe Photoshop CS6"
activate
setdisplay dialogstonever
batch "13 x 19 + sharpen" from filesFotos 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.
tellapplication "Adobe Photoshop CS6"
activate
setdisplay dialogstonever
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 :
batch v : 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 optionsbatch options] : options for Batch
batch options n : 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 !