Natural dimensions in Finder

How can I retrieve the natural dimensions of a QT file without opening in qt player?



try this

set quickTimeFile to choose file
tell application "System Events"
	set q to QuickTime file (quickTimeFile as text)
	set movieDimensions to dimensions of (get 1st track of contents of q whose dimensions is not {0.0, 0.0})
end tell

cool! that worked.

a few questions… why are we using the term dimensions instead of natural dimensions?

aslo, can you explain why we need:
(get 1st track of contents of q whose dimensions is not {0.0, 0.0})

more specicifally the :
whose dimensions is not {0.0, 0.0})

thanks so much
youre awesome

QuickTime file is a class of System Events which provides the parameters of QuickTime files without opening them in QT Player.
To identify the video track it is necessary to check the dimensions, an audio track has the value {0.0, 0.0}.
Quicktime file has no natural dimensions property


You don’t have to use the QuickTime file class, System Events has a Movie file class.
The later has a natural dimensions property (I think that’s the one you were talking about).
Pros: I guess it can handle more video format (and it’s only one line ;))
Cons: it returns 4 figures, only 2 of them are relevant in that case (actually, if somebody knows a case where it is relevant, I’ll be glad to know).

Also, if somebody knows a less dirty way to get rid of the two first figure, please let us know.

set movieFile to (choose file) as string
tell application "System Events" to set {zero, zero, width, height} to natural dimensions of contents of movie file movieFile