MACSCRPT Archives

July 2008

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Andreas Kiel <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Sun, 13 Jul 2008 23:40:56 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (72 lines)
Hi all,

I posted the below already on the AppleScript Studio list as my  
problem was related to that list. But nobody couldn't help.
As it the problem finally is a basic AppleScript problem - maybe  
somebody here has an idea.
Sorry for the double post.

Even though it's around there since Tiger I never had tried the  
Quicktime file suite of System Events.
Today I gave it a try with following script - this meanwhile was  
finally some days ago

set typeList to {}
set t to ((choose file) as text)

tell application "System Events"
	set qt to QuickTime file t
	set tl to (get every track of qt)
	repeat with sl in tl
		set end of typeList to (name of sl)
		set end of typeList to (type class of sl)
		set end of typeList to (audio channel count of sl)
		set end of typeList to (audio sample rate of sl)
		set end of typeList to (audio sample size of sl)
	end repeat
end tell

typeList
-> {,, 0, 0.0, 0,,, 0, 0.0, 0,,, 0, 0.0, 0}

Beside the disappointing result the strange thing is that if I type  
in "type of sl" and compile, it immediately changes to "type class of  
sl" even though "type" is a part of the dictionary
If use other things like "dimensions" they are seen correctly - the  
code seems (sometimes) to return those values which can be read,  
other values just gives wrong results.

If I use QT Player scripting with nearly the same script
set typeList to {}
set t to ((choose file) as text)

tell application "QuickTime Player"
	close every document without saving
	
	open t
	set myMov to document 1
	set tl to (get every track of myMov)
	log (count of tl)
	repeat with sl in tl
		set end of typeList to (name of sl)
		set end of typeList to (type of sl)
		set end of typeList to (audio channel count of sl)
		set end of typeList to (audio sample rate of sl)
		set end of typeList to (audio sample size of sl)
	end repeat
end tell

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?


Regards
Andreas

ATOM RSS1 RSS2