Skip to main content
sz20044
Known Participant
June 22, 2019
Question

Applescript Photoshop Automate Batch

  • June 22, 2019
  • 1 reply
  • 3306 views

I am trying to make an applescript that will launch Photoshop and call the Automate Batch function.  I have zero experience doing this and have only gotten snippets of code from my searching.  I was wondering if someone could help me on this.. in particular if it is at all possible to pass a source folder to the batch call and then how to make the Batch call.  Here is what I have so far, which I am pretty sure doesn't work:

    set sourceFolder to "/Users/Joe/Desktop/Temp" 

    do shell script "echo Source Path is: " & sourceFolder 

 

    tell application "com.adobe.Photoshop" 

        activate 

        try 

            set Batch_Options to {class:batch options, source folder:sourceFolder, destination:save and close, error file:Error_File, file naming:{document name lower, extension lower}, macintosh compatible:true, override open:false, override save:true, suppress open:true, suppressprofile:true, unix compatible:true, windows compatible:true} 

            batch with options Batch_Options 

        end try 

        return "Done" 

    end tell 

Any help is appreciated.

This topic has been closed for replies.

1 reply

Participating Frequently
June 22, 2019

Bonjour

Here the scripts are rather directed javascript (.jsx) that Appelscripts .......

You can consider creating a Droplet or a command line file (Windows) ?

sz20044
sz20044Author
Known Participant
June 24, 2019

Where can I post to find people who utilize Applescript + Photoshop?  This is a pretty simple script... just haven't had the luck finding the best area to post it.

Participating Frequently
June 26, 2019

Maybe someone can help?  This is what I am using... but the syntax on calling doesn't seem to be working

BATCH command

Method

Parameter type

Returns

What it does

batch

(inputFiles, action,

from
[, options])

array of File string
string
BatchOptions

string

Runs the batch automation routine (similar to the File > Automate > Batch command).

The inputFiles parameter specifies the sources for the files to be manipulated by the batch command.

BATCHOPTIONS

Property

Value type

What it is

destination

BatchDestinationType 

Read-write. The type of destination for the processed files (default: BatchDestinationType.NODESTINATION).

destinationFolder

Folder

Read-write. The folder location for the processed files.

Valid only when destination = BatchDestinationType.FOLDER.

errorFile

File

Read-write. The file in which to log errors encountered.

To display errors on the screen (and stop batch processing when errors occur) leave blank.

fileNaming

array of

FileNamingType 

Read-write. A list of file naming options (maximum: 6).

Valid only when destination = BatchDestinationType.FOLDER.

macintoshCompatible

boolean

Read-write. True to make the final file names Macintosh compatible (default: true).

Valid only when destination = BatchDestinationType.FOLDER.

overrideOpen

boolean

Read-write. True to override action open commands (default: false).

overrideSave

boolean

Read-write. True to override save as action steps with the specified destination (default: false).

Valid only when destination = BatchDestinationType.FOLDER or SAVEANDCLOSE.

startingSerial

number

Read-write. The starting serial number to use in naming files (default: 1).

Valid only when destination = BatchDestinationType.FOLDER.

suppressOpen

boolean

Read-write. True to suppress the file open options dialogs (default: false).

suppressProfile

boolean

Read-write. True to suppress the color profile warnings (default: false).

typename

string

Read-only. The class name of the referenced batchOptions object.

unixCompatible

boolean

Read-write. True to make the final file name Unix compatible (default: true).

Valid only when destination = BatchDestinationType.FOLDER.

windowsCompatible

boolean

Read-write. True to make the final file names Windows compatible (default: true).

Valid only when destination = BatchDestinationType.FOLDER.


Hum.......

I do not know Mac!

Test this kind of way:
var yourvariable = new File ('~ / Desktop / whatever you want to open')