Quicktime Export settings contained in script?

I’m building a Quicktime player script that exports a movie as an image sequence with images captured at specified intervals, i.e., 3 seconds, 5 seconds, etc.

Regarding settings, all of the info I’ve read so far indicates you have to either use default settings or recent settings. I want to distribute this to our creative department and I don’t want them to even have a settings file. I’d like to call it on the fly like this:


export front document to (exportFolder & exportPrefix) as image sequence using settings "jpg, .25 fps"

except that doesn’t work. It should save a frame every 4 seconds but it doesn’t seem to do anything.

Here is the portion of the script that exports:

	
			if (can export front document as image sequence) then
				try
					export front document to (exportFolder & exportPrefix) as image sequence using settings "jpg, .25 fps" --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

I would like to have the settings embedded in the AS app. Is there a way to do this so I don’t have to distribute a settings file with the app?

The entire script is posted below:

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:(exportPrefix & " Image Squence")}
				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 settings "jpg, .25 fps" --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

I haven’t been able to get quicktime to export with specific settings directly within AS either. What I do is export one document from quicktime to get the settings right, then write out those settings to a file that quicktime can call from Applescript later.


tell application "QuickTime Player"
	activate
	set filePath to ((path to "desk" as Unicode text) & "ExportedSettings")
	tell document 1
		save export settings for QuickTime movie to file filePath
	end tell
end tell

and then within my AS droplet


...
export front document as QuickTime movie using settings ExportedSettings
...

I’ve then got a central location on our server where I keep those ExportedSettings, so nobody has to know where those settings are, as long as the AS can find them…

Not sure if that solves your problem, (I’ve only ever exported movies, not individual frames), but maybe it’s a path to go down.

Good luck!

-p

Moved topic to correct forum.