Error trying to extract video track in QTPro using script

I have this script – a dropplet/app – that I would drop a QT file(s) on to extract the video tracks and then save to the same folder with _VT appended to the file name. For some reason there is an error extracting. It says: “Can’s get some object”. Here is the code:


on run
	open {choose file}
end run

on open the_files
	repeat with this_file in the_files
		set the_info to info for this_file
		tell application "Finder"
			set this_folder to (container of this_file) as string
		end tell
		--set this_folder to (alias this_file)
		if name of the_info ends with ".mov" or file type of the_info = "MooV" then my process_this_file(this_file)
	end repeat
end open

on process_this_file(this_file)
	tell application "QuickTime Player"
		activate
		open this_file
		display dialog "About to extract video!" buttons {"OK"} default button 1
		make new movie with data track "Video Track" of movie 1
		display dialog "Video Has been extracted." buttons {"OK"} default button 1
		close movie 1 saving no
		save movie 1 in file (this_folder & ":" & 1 & "_VT") as self contained
		close movie 1 saving no
	end tell
end process_this_file

:frowning: I do not understand why it should have any problem in regards to extracting the video. Any ideas?

Mike, first, why are you starting a new thread for the same problem that’s been vexing you–and solved in another thread? One problem with you code appears to be the fact that you are defining this_folder outside the scope of the handler that needs to use it. Another problem with your script is that it will always save the new file as “1_VT” without an extension (something you shouldn’t do in X) and, if you run it on multiple files in the same folder, you will keep overwriting the previous file. Finally, I can’t get your code to work for me on any QT files. The “make new movie…” line compiles but never works right to create a new movie using the video track (QTP 6.4/10.3.1). I still think the solution in the previous thread (that works for multiple users) is the way to go. If you are still having problems with that code, try this:

When I run this script, I get a new file saved in the same location as the source file with “_VT” appended to the name and no audio track (and a smaller file size when I get info on the two files).

Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Jon

To use your methodology but correcting the mistakes I outlined above, this script works to save a new file (with the proper extension) and to make sure each file name is unique:

Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]