我目前正在尝试自动化一个过程,通过这个过程,我获取一个.ai文件,将其保存到桌面上,然后将所有文本更改为大纲,并将另一个副本保存到桌面上,并将_OL添加到桌面上。
IN> server/elements.ai
OUT> desktop/elements.ai & desktop/elements_OL.ai
感谢Tim,它现在保存了,但是它不会选择文本来将其转换为大纲。
如果有人能帮我做这件事,我会非常感激,我在工作中一遍又一遍地做同样的工作,让它自动化将是最好的。
下面是我到目前为止所得到的(修改后包括保存选项、插画版本和文件路径作为字符串)
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
发布于 2014-05-08 18:13:48
工作答案见底部!
我总是使用保存选项,所以这可能是原因。
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}
兼容性选项:插画师10 / Illustrator 11 / Illustrator 12 / Illustrator 13 / Illustrator 14 / Illustrator 15 / Illustrator 3/ Illustrator 8/ Illustrator 9/日文3-创建什么Illustrator文件格式版本(默认:插画15 )
更新:工作保存
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
简而言之,缺少的两件事:
享受:)
更新使用如下:
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
完成了!好好享受吧。
发布于 2014-05-08 14:07:38
您可以只获得fullPath,但不包括扩展,然后将_OL.ai
添加到该扩展的末尾:
set olPath to text 1 thru ((length of fullPath) - 3) of fullPath & "_OL.ai"
https://stackoverflow.com/questions/23405462
复制相似问题