QuickTime to Image Script Help

Hi All

I’m trying to modify a script that I found on this site. I’d like to modify the script so that the exported images go into one main folder instead of individual folders for each video…

Thanks for your help!

on run
	choose file with prompt "Export these video files to image squences:" with multiple selections allowed without invisibles
	open result
end run

on open droppedItems
	tell application "QuickTime Player"
		activate
		close every window
	end tell
	
	set ASTID to AppleScript's text item delimiters
	repeat with thisItem in droppedItems
		set AppleScript's text item delimiters to {"."}
		get name of (info for thisItem without size)
		try
			set exportPrefix to (text items 1 thru -2 of result) as text
		on error
			set exportPrefix to result
		end try
		set AppleScript's text item delimiters to {""}
		
		tell application "Finder"
			try
				make new folder at (container of thisItem) with properties {name:("Processed")}
				set exportFolder to result as Unicode text
			on error errorMsg number errorNum
				display dialog "Error (" & errorNum & "):" & return & return & errorMsg buttons "Cancel" default button 1 with icon caution
			end try
		end tell
		
		tell application "QuickTime Player"
			open thisItem
			
			if (can export front document as image sequence) then
				try
					export front document to (exportFolder & exportPrefix) as image sequence using most recent settings
				on error errorMsg number errorNum
					display dialog "Error (" & errorNum & "):" & return & return & errorMsg buttons "OK" default button 1 with icon caution
				end try
			else
				display dialog "QuickTime Player can't export "" & (thisFile as Unicode text) & "" as an image squence." buttons "OK" default button 1 with icon caution
			end if
			
			close front document
		end tell
	end repeat
	
	set AppleScript's text item delimiters to ASTID
	quit application "QuickTime Player"
end open

Moved the topic to the appropriate forum :slight_smile:

Now the script asks where to export the files…
Changed Quicktime-Player to Quicktime Player 7 (if you do not use 10.6 change this again =) )


on run
	choose file with prompt "Export these video files to image squences:" with multiple selections allowed without invisibles
	open result
end run

on open droppedItems
	tell application "QuickTime Player 7"  --change this on <10.6
		activate
		close every window
	end tell
	-- NEW PART
	tell application "Finder"
		activate
		choose folder with prompt "Export into?"
		set exportFolder to result as Unicode text
	end tell
	-- END NEW PART
	set ASTID to AppleScript's text item delimiters
	repeat with thisItem in droppedItems
		set AppleScript's text item delimiters to {"."}
		get name of (info for thisItem without size)
		try
			set exportPrefix to (text items 1 thru -2 of result) as text
		on error
			set exportPrefix to result
		end try
		set AppleScript's text item delimiters to {""}
		(**
		let's change this... 
		tell application "Finder"
			try
				make new folder at (container of thisItem) with properties {name:("Processed")}
				set exportFolder to result as Unicode text
			on error errorMsg number errorNum
				display dialog "Error (" & errorNum & "):" & return & return & errorMsg buttons "Cancel" default button 1 with icon caution
			end try
		end tell
		**)
		tell application "QuickTime Player 7" --change this on <10.6
			open thisItem
			
			if (can export front document as image sequence) then
				try
					export front document to (exportFolder & exportPrefix) as image sequence using most recent settings
				on error errorMsg number errorNum
					display dialog "Error (" & errorNum & "):" & return & return & errorMsg buttons "OK" default button 1 with icon caution
				end try
			else
				display dialog "QuickTime Player can't export "" & (thisFile as Unicode text) & "" as an image squence." buttons "OK" default button 1 with icon caution
			end if
			
			close front document
		end tell
	end repeat
	
	set AppleScript's text item delimiters to ASTID
	quit application "QuickTime Player"
end open

Perfect! Thanks hubionmac