home *** CD-ROM | disk | FTP | other *** search
- -- This script will process every text track chosen by the user
- tell application "QuickTime Player"
- activate
-
- try
- if not (exists movie 1) then error "No movies are open."
-
- stop every movie
-
- -- CHECK FOR THE CORRECT VERSION OF QUICKTIME
- set the QT_version to (the QuickTime version as string)
- set the player_version to (the version as string)
- set the required_version to "5.0.2"
- if (the QT_version is less than the required_version) or ¬
- (the player_version is less than the required_version) then
- set the error_message to "This script requires QuickTime " & the required_version & " or greater." & ¬
- return & return & ¬
- "Current QuickTime Version: " & QT_version & return & ¬
- "Current QuickTime Player Version: " & player_version
- my upgrade_QT(error_message)
- end if
-
- -- CHECK FOR QUICKTIME PRO
- if QuickTime Pro installed is false then
- set the error_message to "This script requires a QuickTime Pro installation on this system."
- my upgrade_QT(error_message)
- end if
-
- tell movie 1
- -- CHECK IF THE MOVIE IS EDITABLE
- if saveable is false then
- error "This movie has previously been set so that it cannot be copied, edited, or saved."
- end if
- set the track_list to the name of every track whose kind is "Text"
- if the track_list is {} then error "This movie contains no text tracks."
- set the track_names to ¬
- choose from list track_list with prompt "Command-click the target track(s):" with multiple selections allowed
- if the track_names is false then error number -128
-
- repeat with i from 1 to the count of the track_names
- set this_trackname to item i of the track_names
- tell track this_trackname
-
- -- SCRIPT STATEMENTS GO HERE
-
- end tell
- end repeat
- end tell
- on error error_message number error_number
- if the error_number is not -128 then
- beep
- display dialog error_message buttons {"Cancel"} default button 1
- end if
- end try
- end tell
-
- on upgrade_QT(passed_message)
- tell application "QuickTime Player"
- activate
- stop every movie
- set the target_URL to "http://www.apple.com/quicktime/download/"
- display dialog passed_message & return & return & ¬
- "If this computer is currently connected to the Internet, " & ¬
- "click the “Upgrade” button to visit the QuickTime Website." buttons {"Upgrade", "Cancel"} default button 2
- ignoring application responses
- tell application "Finder"
- open location target_URL
- end tell
- end ignoring
- error number -128
- end tell
- end upgrade_QT