IllustratorCS3に付属でついている、ScriptのCollect for Outputで画像を収集した際に、ファイル名が仮に「00」「000」「0000」のファイルがあると、そのファイルの中の一点しか収集しません。回答者はsevenlessさん。Tumblrまとめ(5月)にCollect for Outputスクリプトの書き換えで画像収集を早くするがあったけどイラレCS2の画像収集に、 Collect for Outputを使っているのですが、収集途中にの方が詳しい。
こいつと合成してみる。
(**********************************************************
ADOBE SYSTEMS INCORPORATED
Copyright 2005-2006 Adobe Systems Incorporated
All Rights Reserved
NOTICE: Adobe permits you to use, modify, and
distribute this file in accordance with the terms
of the Adobe license agreement accompanying it.
If you have received this file from a source
other than Adobe, then your use, modification,
or distribution of it requires the prior
written permission of Adobe.
*********************************************************)
global myfolder
on open (myfilesorfolders)
repeat with myitem in myfilesorfolders
tell application "Finder"
if kind of myitem is "folder" then
set myfiles to every file of myitem
repeat with myfile in myfiles
tell me to openAndCollect(myfile)
end repeat
set myfolders to every folder of myitem
tell me to open (myfolders)
else if kind of myitem is "Adobe Illustrator Document" then
tell me to openAndCollect(myitem)
end if
end tell
end repeat
end open
(*
--uncomment this section to process a whole folder when run
on run
set myfolder to choose folder with prompt "Select folder containing Illustrator files to collect output:"
tell me to open {myfolder}
end run
*)
on run
tell application "Adobe Illustrator" to set numDocs to count of documents
if numDocs > 0 then if button returned of (display dialog "Collect the current Illustator document for output?") is "OK" then
collectCurrentDoc()
tell application "Finder"
activate
open folder myfolder
end tell
end if
end run
on openAndCollect(myfile)
try
tell application "Adobe Illustrator" to open myfile with options {update legacy text:true}
collectCurrentDoc()
tell application "Adobe Illustrator" to close document 1 saving no
on error myerr
display dialog myerr
end try
end openAndCollect
on collectCurrentDoc()
activate
set myfolder to (choose folder with prompt "Folder to save collected files") as string
try
tell application "Adobe Illustrator"
with timeout of 600 seconds
set docRef to document 1
set mydocname to name of docRef
save docRef with options {embed linked files:false, PDF compatible:false} in file (myfolder & mydocname)
set myrasters to every raster item of docRef whose embedded is false
set myplaceds to every placed item of docRef
set mytextarts to every text frame of docRef
set theFilepath to file path of docRef
end timeout
end tell
collectArtToLocal(myrasters, theFilepath)
collectArtToLocal(myplaceds, theFilepath)
on error myerr
display dialog myerr
end try
end collectCurrentDoc
on collectArtToLocal(myitems, theFilepath)
tell application "Finder" to set myillfilecontainer to container of theFilepath repeat with myitem in myitems
tell application "Adobe Illustrator" to set myfile to (file path of myitem)
tell application "Finder"
set myfilename to (name of myfile)
set folderContent to every item of folder myfolder
repeat with myFileItem in folderContent
if (myfilename = (name of myFileItem)) then
set matchFlag to 1
exit repeat
else
set matchFlag to 0
end if
end repeat
if (matchFlag = 0) then set mynewfile to (duplicate myfile to myillfilecontainer)
end tell
end repeat
end collectArtToLocal
まとめというよりScriptの意味もさして分からず単なるコピベ(^^;
で、「sevenless」で検索した結果を眺めてみるのもいとおかし。良回答をつけた人のレスを読むだけでも勉強になりまする。



