質問

I'm currently trying to automate a process whereby I take a .ai file, save it to the desktop, then change all the text to outlines and save another copy to the desktop with _OL added to the name, e.g.

IN> server/elements.ai
OUT> desktop/elements.ai & desktop/elements_OL.ai

Thanks to Tim Joe it now saves, but it won't select the text to convert it to outlines.

If someone could help me with this i'll be very grateful, I do this same process over and over again at work and having it automated would be the best.

Here's what I've got so far (revised to include save options, illustrator version and file path as string):

 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
set fullPath to (saveLocation & fileName) --file path of new .ai
set olPath to fullPath & "_OL.ai" --file path of new .ai with outlines


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:true, save multiple artboards:false} --save file to desktop
selectobjectsonactiveartboard --select all
convert to paths --convert all text to outlines
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
役に立ちましたか?

解決

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.

他のヒント

You can get just fullPath up to but not including the extension, and then add _OL.ai to the end of that:

set olPath to text 1 thru ((length of fullPath) - 3) of fullPath & "_OL.ai"
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top