Adobe 26001360 - Illustrator CS - PC Manual page 198

Scripting guide
Hide thumbs Also See for 26001360 - Illustrator CS - PC:
Table of Contents

Advertisement

198
It is not necessary to specify values for all properties. Default values will be provided for any
properties not specified.
Example 48.1
This handler saves all files in a folder as 8 bit PNG files in HTML format with dithering and
interlacing. Note that the class property is specified in the record to ensure that Illustrator
can determine the save option class.
-- fileList is a list of aliases to Illustrator files
-- destinationFolder is an alias to a folder where the PNG files are to be saved
on SaveFilesAsPNG8HTML(fileList, destinationFolder)
set destinationPath to destinationFolder as string
repeat with aFile in fileList
tell application "Finder" to set fileName to name of aFile
set newFilePath to destinationPath & fileName & ".png"
tell application "Illustrator CS"
open aFile
export current document to file newFilePath as PNG8 ¬
with options {class:PNG8 export options ¬
, color count:64 ¬
, color reduction:web ¬
, color dither:pattern dither ¬
, dither percent:50 ¬
, interlaced:true}
close current document saving no
end tell
end repeat
end SaveFilesAsPNG8HTML
-- Call handler
set sourceFolder to choose folder with prompt "Source folder?"
tell application "Finder" to ¬
set fileList to every file of folder sourceFolder as alias list
set destinationFolder to choose folder with prompt "Destination folder?"
SaveFilesAsPNG8HTML(fileList, destinationFolder)
12 Aug 03
AppleScript Reference

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs

Table of Contents