Problem reading movie file properties using System Events

Hi,

I’m trying to write a script that determines the natural dimensions of a movie file without opening Quicktime. From what I can tell, this should be possible to do via the “System Events” movie file suite. However, I think I must be getting the syntax wrong, being new to applescript, as I keep getting a -10000 error. Could anyone please advise?

-Karl

Events and Replies:

tell application “Finder”
get selection
→ {document file “test.m4v” of folder “test” of startup disk}
get name extension of document file “test.m4v” of folder “test” of startup disk
→ “m4v”
get document file “test.m4v” of folder “test” of startup disk
→ “Macintosh HD:test:test.m4v”
end tell
tell application “System Events”
get properties of contents of movie file “Macintosh HD:test:test.m4v”
→ error number -10000

Result:
error “System Events got an error: AppleEvent handler failed.” number -10000

The relevant part of my code is:

– f is a selected item in Finder or an added folder item
on importMovie(f)
tell application “System Events”
set theMovie to f as string
properties of contents of movie file theMovie
– from here on I would like to determine the natural dimensions of the movie file without opening QT
end tell
end importMovie

Hi,

properties of contents does not exist.
You can retrieve the natural dimensions with


on importMovie(f)
	set theMovie to f as string
	tell application "System Events"
		return natural dimensions of contents of movie file theMovie
	end tell
end importMovie

Many thanks!