I have an applescript that gets the time scale from a movie opened in Quicktime Player. It works if the movie’s name (document name) is the same as its file name.
The following opens a file ‘Introduction.mov’ that has a name annotation of ‘Introduction.mov’
tell application "QuickTime Player"
set sound_movie to "Macintosh HD:Users:instructor:Movies:Introduction.mov"
set SoundMov to open sound_movie as alias
--the lines below gets the document name from the file name
set AppleScript's text item delimiters to ":"
set sourcemoviename to the last text item of (the sound_movie as string)
set time_scale to the time scale of document sourcemoviename
display dialog "the time scale is: " & time_scale
end tell
Sometimes the document name of a movie is different than the file name. For some reason that was the case with an .mp4 version of the above movie file ‘Introduction.mp4’ that has a name annotation ‘Introduction 01’. In that case the script above fails. I have tried to get the name of the document once it is opened to ensure the script does not fail but I can’t figure out how to do it.
The following opens a file Introduction.mp4 that has a name annotation ‘Introduction 01’
tell application "QuickTime Player"
set sound_movie to "Macintosh Leopard:Users:instructor1:Movies:Introduction.mp4"
set SoundMov to open sound_movie as alias
-- the line below is intended to get the name of the opened document 'Introduction 01'but will generate and error
set sourcemoviename to the name of document SoundMov
set time_scale to the time scale of document sourcemoviename
display dialog "the time scale is: " & time_scale
end tell
how do I retrieve the properties of an open quicktime movie in Quicktime Player.
BTW this is using Quicktime 7.5.5, Mac OS X 10.5.5 and applescript 2.0.1
mkoob