VikingOSX, this is good, but it also wipes out any other tags that are already on the files.
Here is the big picture of what I am doing. In Final Cut Pro X I have a group of video clips that are scattered around the hard drive. I need to send them to compressor to make smaller versions of them. I tell my script that I have 121 files, so it will loop the correct number of times.
- Have Final Cut reveal the file in the finder.
- Color it purple so I can find it later if problems arise.
- Open it in compressor
- Activate Final Cut and arrow down to select the next file.
- Loop.
Some of my files already have important tags on them. I want to add purple, then be able to search for all them if compressor crashes.
Here is my current script.
if applicationid "com.apple.FinalCut" is running then
display dialog "IS EVERYTHING SETUP AND READY?
Be sure to...
1) Setup Compressor's default setting and location
2) Disable Skimming
3) Put Projects for Export in a keyword collection
4) Select the First Project/Video in the Collection" buttons {"Next"} default button 1 with title "Setup" with icon 2
set n to text returned of (display dialog "DON'T TOUCH ANYTHING while the script is running. This Script is Unstoppable and will take 2 Seconds Per video to complete.
Number of videos to send to Compressor" default answer "0" buttons {"Cancel", "Start"} default button 2 cancel button 1 with title "What Do I Do Now?" with icon 0)
tell applicationid "com.apple.FinalCut" to activate
repeat n times
--REVEAL IN FINDER FROM FINAL CUT
delay 0.5
tell application "System Events" to keystroke "r" using {command down, shift down}
delay 1
--TAG PURPLE AND OPEN IN COMPRESSOR
tell application "Finder"
set sel to selection
if sel is not {} then
set filepath to item 1 of sel--> The path to the one selected item.
set label index of filepath to 5
openfilepathusingapplication fileid "com.apple.Compressor"
end if
end tell
--SELECT NEXT FILE IN FINAL CUT
tell applicationid "com.apple.FinalCut" to activate
delay 0.5
tell application "System Events" to keystroke (key code 125)
end repeat
--CLOSE ALL FINDER WINDOWS
tell applicationid "com.apple.Finder" to activate
--tell application "System Events" to keystroke "w" using {command down, option down}
tell applicationid "com.apple.Compressor" to activate
(delay 2) activate
display dialog "Done. Go check Compressor." buttons {"Close"} default button 1 with title "I'm Finished!" with icon 2
else
display dialog "Please Launch FCP X and Prepare For Sharing" buttons {"OK"} default button {"OK"} with title "You Forgot One Little Detail..." with icon 2
end if