On Jul 14, 2008, at 10:04 AM, Andreas Kiel wrote:
> Thanks Mark
>
> On 14.07.2008, at 02:04, Mark Lively wrote:
>
>>>
>>> typeList
>>> -> {"Video Track", "vide", 0, 0.0, 0, "Sound Track", "soun", 2,
>>> 48.000499725342, 24, "Timecode Track", "tmcd", 0, 0.0, 0}
>>> so that works and is correct (somehow: the sample rate looks a bit
>>> strange)
>>>
>>> In both cases it's the same QT file.
>>>
>>> Any ideas what I'm doing wrong?
>>
>> I think the problem is with system events.
> ... and for the confirmation that I'm not an idiot
>
>>
>> If you are using Studio you have a few additional options. You can
>> load the movie into a player and use that to get some or all of the
>> properties (haven't done this, not sure which ones you can get)
> I got some simple steps there, but my Cocoa knowledge is around +- 0.
>>
>> A second option is to use call method and make cocoa calls the
>> quick time libraries. Once again, I haven't done this but you
>> should be able to make a QTMovie and get the QTTracks.
> See above
>
> Thanks
> Andreas
>
Very quick and very dirty, but I hope this helps.
on launched theObject
--display dialog name of every text field of window 1
set myMovie to POSIX path of (choose file)
set qtMovie to call method "movieWithFile:error:" of class "QTMovie"
with parameters {myMovie, 0}
mylog(myMovie)
set aname to call method "movieAttributes" of qtMovie ---This returns
a dictionary the same as an AS record
set aname to call method "description" of aname --Quick and Dirty way
to convert it to text
mylog(tab & aname)
set tracklist to call method "tracks" of qtMovie
repeat with atrack in tracklist
--returns a record that you can pull apart
set aname to call method "trackAttributes" of atrack
set trackname to |QTTrackDisplayNameAttribute| of aname
mylog(trackname)
set aname to call method "description" of aname
mylog(tab & tab & aname)
-- to get one attribute
-- set aname to call method "attributeForKey:" of atrack with
parameter "QTTrackDisplayNameAttribute"
end repeat
end launched
on mylog(someText)
set oldcontent to content of text view 1 of scroll view "myBox" of
window 1
set content of text view 1 of scroll view "myBox" of window 1 to
oldcontent & someText & return
end mylog
-Mark
who should have thought of calling description on a record a LONG LONG
time ago.
|