作成する
tell application "Adobe Illustrator"
make new document with properties {color space:CMYK}
end tell
保存せずに閉じる
tell application "Adobe Illustrator" close document 1 saving no end tell保存する
set fileRef to "Macintosh HD:test.eps" as text
tell application "Adobe Illustrator"
--通常のAI保存
save document 1 in file fileRef
--eps保存
save document 1 in file fileRef as eps with options ¬
{class:EPS save options, compatibility:Illustrator 10, embed all fonts:true}
--PDF保存
save document 1 in file fileRef as eps with options ¬
{class:PDF save options, compatibility:Acrobat 4, preserve editability:true}
end tell
gif書き出し
set SaveFolder to choose folder with prompt "保存フォルダを選択してください"
tell application "Adobe Illustrator"
activate
tell document 1
set saveF to (SaveFolder as text) & "myPicture.gif"
export to file saveF as GIF with options ¬
{class:GIF export options, horizontal scaling:200, vertical scaling:200}
end tell
end tell
ロックされていない一旦すべて非表示にして、その後レイヤーを順に表示してgif出力。Web用のボタンをつくるのに便利なスクリプトです。
set SaveFolder to choose folder with prompt "保存フォルダを選択" tell application "Adobe Illustrator" activate tell document 1 set countLayer to count layer--レイヤーの数を数える repeat with t from 1 to countLayer--レイヤー分繰り返す if layer t is not locked then --もしロックされていなければ --ロックされていないレイヤーをぜんぶ非表示にする set visible of layer t to false end if end repeat repeat with t from 1 to countLayer--レイヤー分繰り返す if layer t is not locked then--もしロックされていなければ set visible of layer t to true--レイヤーを表示する set OutName to name of layer t--レイヤー名を取り出す set saveF to (SaveFolder as text) & (OutName as text) & ".gif" --レイヤー名でファイル名を作成 export to file saveF as GIF--レイヤー名でGIF書き出し --export to file saveF as JPEG/Photoshop/SVG/PNG8/PNG24 --などいろいろ選べる set visible of layer t to false--レイヤーを非表示にする end if end repeat end tell end tell
コメントする