Hi, Andreas--
There's some QT stuff that is scriptable, though you cannot depend on the dictionary for every definition. Here's a script, for example, that merges a file of captions in scc format with a movie file in mp4 format:
tell application "QuickTime Player 7" activate open sccFile tell document 1 select all copy close front window end tell open mp4File tell document 1 select all rewind add
repeat with aTrack in tracks tell aTrack if kind is "Video" then set vTrack to aTrack if kind is "Closed Caption" then set ccTrack to aTrack end tell end repeat
set vTrackDims to the dimensions of vTrack set the dimensions of ccTrack to vTrackDims
end tell end tell tell application "System Events" tell process "QuickTime Player 7" set frontmost to true keystroke "t" using {command down, option down} end tell end tell log "Done."
Most of the code is in the form of QT direct commands. They are not all, however, taken from the .sdef. Thanks to Jim Weisbin for the proper incantation to "add" the captions track to the movie. I'm hoping someone (maybe Jim?) will know the proper incantation for the last step.
On Apr 13, 2014, at 12:24 PM, blinkboks wrote: Btw, it's possible to 'get' values etc. but I have not yet succeded 'setting' then...
/Andreas I have just spent a week making QT 7 pro scripts. Its dictionary or 'scriptability' seems to be broken. Took me a loooong time to figure out how to script it, with apparantly no help from the net.
Had to do everything via gui scripting. Even mousetools, that I normally use for gui clicking, needed an extra 'release click' – never seen that with other apps.
Would love to see a fix for this (QT 7), as my scripts would be a lot more smooth, and probably faster...
/Andreas Blinkenberg Denmark Hi--
Does anyone perchance know the proper syntax to get QuickTime Pro 7 to turn on captions?
(Manually, you'd click on View -> Show Closed Captioning ⌥⌘T)
QT's dictionary shows a property of the application which looks promising:
show closed captioning when available (boolean) : show closed captioning (when supported by content)
However, a naîve interpretation...
tell application "QuickTime Player 7" set show closed captioning when available to true end tell
...doesn't seem to do anything.
This works:
tell application "System Events" tell process "QuickTime Player 7" set frontmost to true keystroke "t" using {command down, option down} end tell end tell
But it makes QT frontmost, which mars my script's generality. Also, ⌥⌘T is a toggle. If you do it again, it turns captions off.
Any ideas?
--Gil
|