Automator and Applescript to export movie with quicktime

I have started a work flow that asks for some files from a folder and then passes the list to an Applescript. So far the script is:

on run {input, parameters}
	set output_items to {}
	tell application "QuickTime Player"
		activate
		close every window
	end tell

	repeat with i in input
		tell application "QuickTime Player"
			open (i as alias)
			
			-- HERE HERE HERE
			
			close front document
		end tell
	end repeat
	
	return output_items
end run

What I cannot figure out is how to get the file name excluding the extension where I have “HERE HERE HERE”. I want to be able to get Quicktime to export the file to the desktop with the same file name as a Quicktime Movie. I cannot figure out how to do this…any help?

Hi,

try this


on run {input, parameters}
	set output_items to {}
	set dt to path to desktop as text
	tell application "QuickTime Player"
		activate
		close every window
		repeat with i in input
			open (i as alias)
			set {name:Nm, name extension:Ex} to info for (i as alias)
			if Ex is missing value then set Ex to ""
			if Ex is not "" then set Nm to text 1 thru ((count Nm) - (count Ex) - 1) of Nm
			set newFile to dt & Nm & ".mov"
			export front document to newFile as QuickTime movie
			set end of output_items to newFile as alias
			close front document
		end repeat
	end tell
	return output_items
end run


thank you so much. that worked great!