Skip to content

Instantly share code, notes, and snippets.

@jeffrafter
Created June 8, 2010 05:32
Show Gist options
  • Save jeffrafter/429651 to your computer and use it in GitHub Desktop.
Save jeffrafter/429651 to your computer and use it in GitHub Desktop.
Exporting XML from Final Cut Pro using Apple Script
#!/bin/sh
# 'Enable access for assistive devices' must be selected in Universal Access preferences.
osascript -e "
try
tell application \"Final Cut Pro\" to activate
delay 0.5
tell application \"System Events\"
tell process \"Final Cut Pro\"
tell menu bar 1
tell menu bar item \"File\"
tell menu \"File\"
tell menu item \"Export\"
tell menu \"Export\"
click menu item \"XML...\"
end tell
end tell
end tell
end tell
end tell
tell its front window
click button \"OK\"
end tell
delay 0.5
tell its front window
click button \"Save\"
delay 0.5
try
click button \"Replace\" of sheet 1
on error error_message
end try
end tell
end tell
end tell
on error error_message
tell application \"Final Cut Pro\" to display dialog error_message buttons {\"OK\"} default button 1
end try"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment