here’s the script. it works great for converting freehand files to illustrator, but whenever theres a file like “sp1293 st. croix” the new file becomes “sp1293 st.ai” the .ai in the filename is also problematic because spotlight wont search through it. the .ai does not get put on when everything else goes right in the script, btw.
thanks,
jordan
on open theseFiles
repeat with thefile in theseFiles
tell application "Finder"
set {original_filename, savepath} to {name, container} of thefile
if original_filename contains "FH-OLD" then
set nofhold to text 1 thru -7 of original_filename
set name of thefile to nofhold
set original_filename to nofhold
end if
try
set newName to ("^" & (text 1 thru 20 of original_filename) & ".EPS")
on error
set newName to ("^" & (text of original_filename) & ".EPS")
end try
end tell
with timeout of 800 seconds
tell application "FreeHand MX"
activate
open thefile
save document 1 in file ((savepath as text) & newName) as GenericEPS with IncludeFHDocInEPS
close document 1 saving no
end tell
end timeout
tell application "Finder" to set name of thefile to text of original_filename & "FH-OLD"
set epsPath to ((savepath as text) & newName)
set olddelims to AppleScript's text item delimiters
tell application "Adobe Illustrator" -- Will also work in AI 10.
activate
open file epsPath
set ruler origin of current document to {0.0, 0.0}
set position of group item 1 of layer 1 of current document to {10, 600}
save current document in ((savepath as text) & original_filename) as Illustrator with options {compatibility:Illustrator 13, compressed:false, embed ICC profile:true, embed linked files:true, font subset threshold:100, PDF compatible:true}
end tell
tell application "Finder" to delete file epsPath
set AppleScript's text item delimiters to olddelims
end repeat
end open