script to export a folder of Freehand MX files to genericEPS files.

Hello guys,

Tommorrow I have to deliver a few hundred files in eps. But they are all in Freehand MX. I have no experience of what so ever in applescript. Have been googling all day, but I am not capable of making a script. Is there anybody that can give me an example and some tips how I can do this??
Even after tomorrow, this is still very important beceause I have to do this more often…
Hope somebody can help me…

Onnozel :o
mailto:onno@ecorn.nl

Model: Powerbook 17"
Browser: Safari 412
Operating System: Mac OS X (10.4)

Onnozel,

Don’t know if this will help or not. I haven’t done much with Freehand scripting but this is what I worked out. I could not get Freehand to save into a different folder directly so I had to use the Finder to move the files.

tell application "Finder"
	choose folder with prompt "Choose folder with files to convert."
	set fPath to result as alias 
-- this sets the path to the folder with the files you want to convert
	choose folder with prompt "Choose destination folder"
	set destPath to result as alias 
-- this sets the path to where you will save your new files
	set cnt to count every file of folder fPath
	
	repeat with i from 1 to cnt
 -- this is a loop that repeats as many times as you have files to convert ( they must all be files not folders or it will give you an error and stop).
		set filePath to file i of fPath
-- this sets the path to the first file in the folder being converted.
		set fName to name of filePath
-- this gets the name of the first file.
		set newName to fName & ".eps"
-- this sets the name of the file that is being converted so you can reference it and move it.
		tell application "FreeHand MX"
			activate
			open filePath
			save front document as GenericEPS with IncludeFHDocInEPS
			close front document
		end tell
		move file newName of fPath to destPath
-- this moves the new file to your destination folder.
	end repeat
end tell

I’m sure someone out there may be able to simplify this but this is what I came up with. Hope it helps.

Model: G5 dual 1.8
AppleScript: 1.9.3
Browser: Safari 125.12
Operating System: Mac OS X (10.3.8)

Thank you so much!!!

an hour ago I found this script and this one works as well. I just bought an apple a week ago, but starting to like the community already! This saves me soo mucht time…

Here is the script I found

on run
display dialog "Drop any FreeHand File(s) onto this script " & ¬
"and it will launch the most recent version of FreeHand 11 " & ¬
"you have installed and open theses files. It will then export " & ¬
“the EPS files in a location you specify.” & return & return & ¬
“” buttons “OK” default button 1
end run

on open x
with timeout of 16400 seconds
tell application “Finder”
try
set originFolder to choose folder with prompt “Where do you want to save your EPS files?”
on error
beep
display dialog ¬
"You must have Navigation Services installed " & ¬
“to run this script.” buttons {“Cancel”} ¬
default button “Cancel”
end try
set temp to display dialog ¬
“Do you wish to save the FreeHand file within " & ¬
“the EPS file?” & return & return & ¬
Yes will make the files bigger.” & return & ¬
No will make the files smaller.” & ¬
“” buttons {” Yes ", “No”} default button 1
if button returned of temp = " Yes " then
set withEPS to true
else
set withEPS to false
end if
set droppedFiles to count x
repeat with cnter from 1 to droppedFiles
set currentfile to item cnter of x
if withEPS then
exportfh11files2(currentfile, originFolder) of me
else
exportfh11files(currentfile, originFolder) of me
end if
end repeat
end tell
end timeout
end open

– start export functions for FreeHand 11
on exportfh11files(currentfile, originFolder)
set EPS_Location to originFolder & currentfile & “.eps” as string
tell application “FreeHand MX”
open currentfile without Dialogs – change with or without if you do or don’t want to see font or link warnings
save last document as MacEPS in file EPS_Location without IncludeFHDocInEPS – change with or without if you do or don’t want to save document in EPS file
close last document
end tell
end exportfh11files

on exportfh11files2(currentfile, originFolder)
set EPS_Location to originFolder & currentfile & “.eps” as string
tell application “FreeHand MX”
open currentfile without Dialogs – change with or without if you do or don’t want to see font or link warnings
save last document as MacEPS in file EPS_Location with IncludeFHDocInEPS – change with or without if you do or don’t want to save document in EPS file
close last document
end tell
end exportfh11files2