QuickTime movie 1 exists?

My long range goal is to make an Automator Workflow that looks into a folder, finds all the movies (.avi etc.), saves a .jpg of the middle frame. This all might be rolled into a larger Workflow that downloads photos from a digital camera and loads the photos and middle frame of the movies into Aperture.

I thought I’d start with existing QuickTime Scripts from Apple.

If I run the “Select from Beginning” script I get as a log:

tell application "QuickTime Player"
	exists movie 1
	display dialog "No movies are open." buttons {"Cancel"} default button 1
		"QuickTime Player got an error: User canceled."

The beginning of the script is:

tell application "QuickTime Player"
		if not (exists movie 1) then error "No movies are open."

I have a .mov open, so don’t understand the error. Doesn’t matter if I run from the script menu or Script Editor.

Thanks for any ideas. Any other places to look for QuickTime help? I do have some resources at home which I’ll be able to access next week and that may help.

I have QuickTime Pro.

See the QuickTime dictionary - you have to tell QT to open the file - open doesn’t mean just open on the desktop it means opened by the script. Same is true of images. This script (for Image Events) shows what I mean:

set main_path to path to desktop as Unicode text
set selectedFile to (choose file) --Here you choose the file you want to convert.
set new_name to text returned of (display dialog "Enter new name for file:" default answer "") --Here you enter the new name of the converted file.
set new_file to (main_path & new_name & ".jpg") as Unicode text
--- This is typical of image or QT processing
tell application "Image Events"
	set openedFile to open (selectedFile as alias)
	save openedFile in new_file as JPEG --This is the critical stage; you have to save IN the new file.
	close openedFile
end tell

Thank you. Since I have to identify the files anyway, this won’t add anything.

I just was trying to test the part I understood the least. I guess I shouldnt’ be too surprised the Apple supplied script didnt’ work.

I also realized I posted in the wrong group; but I had looked at both groups.