See Bottom for working Answer!
I always use save options so that could be the reason.
save theCurrentFile in file NewFileNamePath as as Illustrator ¬
with options {class:Illustrator save options ¬
, compatibility:Illustrator 15 ¬
, font subset threshold:0.0 ¬
, embed linked files:false ¬
, save multiple art boards:false}
compatibility options: Illustrator 10 / Illustrator 11 / Illustrator 12 / Illustrator 13 / Illustrator 14 / Illustrator 15 / Illustrator 3 / Illustrator 8 / Illustrator 9 / Japanese 3 -- what Illustrator file format version to create ( default: Illustrator 15 )
Update: working save
set saveLocation to ((path to desktop) as string) --You were missing as string so it was making an array. The array adds "," making an invalid save location.
set theFile to choose file --choose .ai file to get outlines on
tell application "Finder" to set fileName to name of theFile
set fullPath to saveLocation & fileName --file path of new .ai
--set olPath to fullPath & "_OL.ai" --file path of new .ai with outlines
log fullPath
tell application "Adobe Illustrator"
activate
open theFile without dialogs
save current document in file fullPath as Illustrator with options {class:Illustrator save options, compatibility:Illustrator 15, font subset threshold:0.0, embed linked files:false, save multiple artboards:false}
end tell
In short the two missing things:
- compatibility:Illustrator 15 --Must have a version number, you were missing it
- set saveLocation to ((path to desktop) as string) -- needs to be a string
enjoy :)
Update Use this:
set saveLocation to ((path to desktop) as string) --place to save the files
set theFile to choose file --choose .ai file to get outlines on
tell application "Finder" to set fileName to name of theFile
tell application "Finder" to set fileNameExention to name extension of theFile
set trimNumber to (((count fileNameExention) + 2) * -1) -- add two to include period and placment
set fileName to (characters 1 thru -4 of fileName) as string -- get just the file name with not extention
set fullPath to (saveLocation & fileName) --file path of new .ai
set VectorPath to fullPath & ".ai"
set olPath to fullPath & "_OL.ai" --file path of new .ai with outlines
tell application id "com.adobe.Illustrator"
activate
open theFile without dialogs
save current document in file VectorPath as Illustrator with options {class:Illustrator save options, compatibility:Illustrator 15, font subset threshold:0.0, embed linked files:true, save multiple artboards:false} --save file to desktop
convert to paths (every text frame of current document)
display dialog "pause"
save current document in file olPath as Illustrator with options {class:Illustrator save options, compatibility:Illustrator 15, font subset threshold:0.0, embed linked files:true, save multiple artboards:false} --save another copy to desktop with name + _OL.ai
quit
end tell
Done! Enjoy.