Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

photoshop applescript

Could anybody help me ?


What I want to do : I want to run a batch action for every file from a selected folder, creating (or at least pointing to) another folder as a destination.


I tried to read the apple scripting reference for photoshop but couldn't make it. There are no samples to figure how it works.


That's what I tried without sucess ...


"

set pasta_origem to choose folder with prompt "Select original folder:"

set pasta_destino to choose folder with prompt "Select target folder:"


tell application "Adobe Photoshop CS4"

activate

batch "13 x 19 + sharpen" from "Ações CFotos" from files list of pasta_origem with options destination folder pasta_destino

error file

override save

windows compatible

end tell

"


Any help would be really usefull.


Tks !

Posted on Jun 18, 2012 7:57 PM

Reply
Question marked as Best reply

Posted on Jun 19, 2012 6:49 PM

Hi,


Here is an example

-------------------------------------------

set pasta_origem to choose folder with prompt "Select original folder:"

set pasta_destino to choose folder with prompt "Select target folder:"

set fileToLog to (pasta_destino as string) & "Photoshop_Batch_Errors_Log.txt"


tellapplication "Finder"

setPhotoshopFilestodocument filesofpasta_origemasalias list

if not (exists file fileToLog) then

make new file at pasta_destino with properties {name:"Photoshop_Batch_Errors_Log.txt"}

end if

endtell

tell application "Adobe Photoshop CS4"

activate

batch "13 x 19 + sharpen" from "Ações CFotos" from filesPhotoshopFileswith options {destination:folder, destination folder:pasta_destino, error file:aliasfileToLog, windows compatible:true, file naming:{document name lower, extension lower}, suppress open:true, override save:true}

endtell

-------------------------------------------


Important : override save:true When this option is true, files will be saved to the destination folder only by “save as” steps in the action "13 x 19 + sharpen". If there are no “save” or “save as” steps, no files will be saved, in this case set it to false or remove ,override save:true in options .

3 replies
Question marked as Best reply

Jun 19, 2012 6:49 PM in response to LeCastello

Hi,


Here is an example

-------------------------------------------

set pasta_origem to choose folder with prompt "Select original folder:"

set pasta_destino to choose folder with prompt "Select target folder:"

set fileToLog to (pasta_destino as string) & "Photoshop_Batch_Errors_Log.txt"


tellapplication "Finder"

setPhotoshopFilestodocument filesofpasta_origemasalias list

if not (exists file fileToLog) then

make new file at pasta_destino with properties {name:"Photoshop_Batch_Errors_Log.txt"}

end if

endtell

tell application "Adobe Photoshop CS4"

activate

batch "13 x 19 + sharpen" from "Ações CFotos" from filesPhotoshopFileswith options {destination:folder, destination folder:pasta_destino, error file:aliasfileToLog, windows compatible:true, file naming:{document name lower, extension lower}, suppress open:true, override save:true}

endtell

-------------------------------------------


Important : override save:true When this option is true, files will be saved to the destination folder only by “save as” steps in the action "13 x 19 + sharpen". If there are no “save” or “save as” steps, no files will be saved, in this case set it to false or remove ,override save:true in options .

Jun 19, 2012 7:40 PM in response to Jacques Rioux

Hi Jacques. Tks for the help.


I think we got closer now: I compiled it but when I ran it, it opened the batch dialog without automatically runnig it.


In the source option it was set "Bridge" (is it all right ?) and no destination folder was set.


Seems that it's not considered the source files list and/or the destination folder.


Any ideas now ? Tks for the answer !

Jun 19, 2012 8:22 PM in response to LeCastello

LeCastello wrote:

I think we got closer now: I compiled it but when I ran it, it opened the batch dialog without automatically runnig it.


To controls whether or not Photoshop displays dialogs, use "setdisplay dialogsto ....."

----------------------------------------------------

tell application "Adobe Photoshop CS4"

setdisplay dialogstonever-- never, always or error dialogs

----------------------------------------------------



LeCastello wrote:

In the source option it was set "Bridge" (is it all right ?) and no destination folder was set.


Seems that it's not considered the source files list and/or the destination folder.


Yes, this is the normal behavior when using a script.

photoshop applescript

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.