Reputation: 5
I’m trying to pass a dynamically generated list of file paths to a Photoshop (PS) droplet for processing.
I got most of the way but I’m stuck as the Photoshop droplet only processes one of the files that gets handed off.
The image files are quite large (above 1GB) and each will require some time to be processed, that’s why I decided to place the PS Droplet processing as a final step of the AppleScript. Originally I was trying to drop one file at the time on the PS droplet but the AppleScript processes the files faster than the PS droplet, leaving me with just one image done. I couldn’t find a way to pause the AppleScript until the javascript in the PS droplet was complete.
This is what the Scrip Editor recorder when I dropped 2 file on the PS droplet. I tried to concatenate each string in the list with the same syntax but I was unsuccessful.
tell application "Finder"
activate
open {document file "2024_03_27_01_M.tif" of folder "Test 2 copy" of folder "Scan" of folder "Scans" of disk "VIDEO-REC", document file "2024_03_27_02_M.tif" of folder "Test 2 copy" of folder "Scan" of folder "Scans" of disk "VIDEO-REC"} using application file "Scan_Preview.app" of folder "Scans" of disk "VIDEO-REC"
end tell
I’ve tried:
At best case scenario I’m only able to have only one files processed by the PS Droplet.
I have spent quite some time looking and trying multiple alternative but I’m at a loss.
This is what I have in the testing script at the moment:
property imagesForDroplet : {} #list of items to process with Photoshop Droplet
property toPsDroplet : "/Volumes/VIDEO-REC/Scans/Scan_Preview.app" # location of the PS Dropplet
on open (theFiles)
delay 0.1
activate
set i to 1
repeat with aFile in theFiles
set newFilePath to aFile -- just a place holder for the new file directory
set the end of imagesForDroplet to newFilePath as string
set i to i + 1
end repeat
choose from list imagesForDroplet
tell application "Finder"
activate
set toPsDropletHFS to POSIX file toPsDroplet as string
open document file imagesForDroplet as alias using application file toPsDropletHFS
end tell
end open
Any help would really be appreciated.
Upvotes: 0
Views: 41