Using Automator to Export Multiple FH Docs to EPS

Hi All,

I have a script which will allow me to drop multiple Freehand files on it to export EPS files. I would like to build this into an Automator Workflow that will allow me to “Find Finder Items” and pass the results on to the "Run Applescript " module.

The script works fine on it’s own but I can’t get it to work inside of Automator. What am I doing wrong?

on open theseFiles
	repeat with thefile in theseFiles
		tell application "Finder" to set {original_filename, savepath} to {name, container} of thefile
		set newName to text 1 thru 8 of original_filename & ".EPS"
		tell application "FreeHand MX"
			open thefile
			save document 1 in file ((savepath as text) & newName) as MacEPS with IncludeFHDocInEPS
			close document 1 saving no
		end tell
	end repeat
end open

Thanks In Advance,

Lunarlandr

the Run AppleScript action of Automator has a special syntax


on run {input, parameters}
	repeat with thefile in input
		tell application "Finder" to set {original_filename, savepath} to {name, container} of thefile
		set newName to text 1 thru 8 of original_filename & ".EPS"
		tell application "FreeHand MX"
			open thefile
			save document 1 in file ((savepath as text) & newName) as MacEPS with IncludeFHDocInEPS
			close document 1 saving no
		end tell
	end repeat
	return input
end run

Thanks Stefan,

That did the trick:)

Lunarlandr

As it turns out, the repeat in the above script is causing problems when run through Automator and Power Switch. Apparently the Power Switch configurator has the repeat built in. When I try to remove the repeat, I have nothing but problems. How do I accomplish this?

Lunarlandr

Sorry, I have no idea what Power Switch does

Power Switch is workflow automation. In my current flow files are downloaded from FTP, unzipped, archived, Freehand files Exported to EPS, the EPS is checked for integrity and it is dropped into our prepress software package (Prinergy). When adding my Automator Worflow to the Power Switch configurator my wokflow is basically placed into another workflow with Input and Output steps before and after. All my worflow needs to accomplish is to open the Freehand file (F1234567.FH11) and save it out as an eps (F1234567.EPS). Power Switch basically sees things 1 file at a time. Does this help?

Need more info on power switch go to www.gradual.com.

Lunarlandr

not really. It seems quite complicated. In the info it’s not described how Power Switch and AppleScript/Automator work together.
May somebody could help who uses Power Switch. I unfortunately don’t