So, I am getting close to getting this script working but something is still not working.
I have a folder action script (which I’ve revised to work as a standalone script). It is to send a job to the command line version of Compressor. Anyway, work in progress script below:
--on adding folder items to thisFolder after receiving theItems
set theItems to choose file with prompt "Select File"
tell application "Finder"
set file_name to displayed name of theItems
--repeat with i in theItems
-- set theName to the name of (item i of theItems)
--end repeat
set compressor_appfile to (application file id "com.apple.compressor.Compressor" as Unicode text)
set theFiles to the quoted form of the POSIX path of theItems
set myCluster to the quoted form of "-clustername AntonMacBookPro"
set the compressor_UNIXfile to (compressor_appfile & ":Contents:MacOS:Compressor") as alias
set the UNIXfile_path to the quoted form of the POSIX path of the compressor_UNIXfile
--
--repeat with f in theItems
-- wait for the item to be all there. Since it can take a few minutes for a file to copy over.
-- set Was to 0
-- set isNow to 1
-- repeat while isNow ≠Was
-- set Was to size of (info for f)
-- delay 30 -- longer if getting the item is slow
-- set isNow to size of (info for f)
-- end repeat
--do shell script UNIXfile_path & space & "-clustername AntonMacBookPro\\ Cluster" & space & "-jobpath" & space & theFiles & space & "-settingpath" & space & (quoted form of "/Users/anton/Library/Application\\ Support/Compressor/Apple\\ ProRes\\ 422\\ Interlace.settings") & space & "-destinationpath" & space & (quoted form of "/Users/anton/Movies/") & file_name
do shell script (UNIXfile_path & space & "-clustername" & space & "AntonMacBookPro" & space & "-jobpath" & space & theFiles & space & "-settingpath" & space & (quoted form of "/Users/anton/Library/Application Support/Compressor/Apple ProRes 422 Interlace.settings") & space & "-destinationpath" & space & (quoted form of "/Users/anton/Movies/") & file_name)
end tell
--end repeat -- get next item f in thisFolder
--end adding folder items to
The resulting Event Log is this:
tell current application
choose file with prompt “Select File”
alias “Macintosh HD:Users:anton:Movies:Converted:C0013.mov”
end tell
tell application “Finder”
get displayed name of alias “Macintosh HD:Users:anton:Movies:Converted:C0013.mov”
“C0013.mov”
get application file id “com.apple.compressor.Compressor”
“Macintosh HD:Applications:Compressor.app”
do shell script “‘/Applications/Compressor.app/Contents/MacOS/Compressor’ -clustername AntonMacBookPro -jobpath ‘/Users/anton/Movies/Converted/C0013.mov’ -settingpath ‘/Users/anton/Library/Application Support/Compressor/Apple ProRes 422 Interlace.settings’ -destinationpath '/Users/anton/Movies/'C0013.mov”
“”
end tell
But the job doesn’t get submitted.
If I would submit the job in terminal, I would do the following command:
cd /Applications/Compressor.app/Contents/MacOS
and then I would have to do:
./Compressor -clustername AntonMacBookPro -jobpath /Volumes/SourceLocation/ClipToCompress.mov -settingpath /Users/TheUsersName/Library/Application\ Support/Compressor/TheSettingYouWant/setting -destinationpath /Users/DestinationFolder/theCompressedFileName.mov
This works every time.
So, what isn’t translating right?
Cheers.