Choose file to Dropped file

Hi all,

I am a complete newbie, so bear with me.

I have a simple script to convert Freehand MX files to EPS. The problem is that I need it to work with dropped files and it is set to choose file. How do I change this (I’m sure it is really simple)?

The ultimate goal is to use this with Automator, so that when a group of folders containing several Freehand files and their support files are dropped on it - Automator will find the Freehand files and pass them on to the script, which will save out EPS files.

Am I barking up the wrong tree - overcomplicating the issue here?

Here is the script:

set thefile to choose file
tell application "Finder" to set original_filename to name of thefile
set filepath to thefile as string
set myoffset to offset of original_filename in filepath
set savepath to text 1 thru (myoffset - 1) of filepath
set newName to text 1 thru 8 of original_filename & ".EPS"
tell application "FreeHand MX"
	open thefile
	save document 1 in file (savepath & newName) as MacEPS with IncludeFHDocInEPS
	close document 1 saving no
end tell

Any help would be greatly appreciated.

Lunarlandr

Hi,

try this


on run
	display dialog "drop files onto the icon"
end run

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