I am having some trouble getting the resolution set properly when exporting SWF files from Illustrator CS3. I have tried setting the resolution as a variable and calling it in the export command, but still no luck. The other options seems to be working fine. The default it 72, but raster images look like crap at 72. My EPS/AI version looks fine, though.
Illustrator CS3’s dictionary says:
copy text item delimiters of AppleScript to savedDelim
set text item delimiters of AppleScript to {":"}
set text item delimiters of AppleScript to savedDelim
set myName to name of (info for (path to me))
set FileSample to choose folder with prompt "Choose an input folder."
set outputPath to choose folder with prompt "Choose an output folder. The input folder is suggested."
set folderName to name of (info for FileSample)
tell application "Finder" to set theFiles to files of folder FileSample whose name extension is in {"tif", "tiff", "eps", "ai", "ART1", "ART2", "ART3", "ART4"} or kind contains "Postscript" or kind contains "EPS" or kind contains "Illustrator" or kind contains "ART5"
repeat with oneFile in theFiles
tell application "Adobe Illustrator"
activate
open (oneFile as alias) with options {update legacy text:true} forcing CMYK without dialogs
tell front document
try
if locked of layer is true then
set locked of layer to false
else
set selected of every page item to true
end if
end try
export as Flash with options {convert text to outlines:true, generate HTML:false, version:8, preserve appearance:true, resolution:150 as real} to outputPath
close without saving
end tell
end tell
end repeat
tell application "Finder"
activate
display dialog "All input files have been processed." buttons "Ok" default button 1
end tell
Model: Dual 2.3GHz G5
AppleScript: 2.1.1/Script Debugger 4
Browser: Firefox 2.0.0.6
Operating System: Mac OS X (10.4)
Got it! It was ‘output resolution’ not ‘resolution.’ Here is the final.
copy text item delimiters of AppleScript to savedDelim
set text item delimiters of AppleScript to {":"}
set text item delimiters of AppleScript to savedDelim
set FileSample to choose folder with prompt "Choose an input folder."
set outputPath to choose folder with prompt "Choose an output folder. The input folder is suggested."
set folderName to name of (info for FileSample)
tell application "Finder" to set theFiles to files of folder FileSample whose name extension is in {"tif", "tiff"} or kind contains "tif"
repeat with oneFile in theFiles
tell application "Adobe Illustrator"
activate
open (oneFile as alias) with options {update legacy text:true} forcing CMYK without dialogs
tell front document
export as Flash with options {convert text to outlines:true, generate HTML:false, version:8, preserve appearance:true, output resolution:150} to outputPath
close without saving
end tell
end tell
end repeat
tell application "Finder"
activate
display dialog "All input files have been processed." buttons "Ok" default button 1
end tell
Model: Dual 2.3GHz G5
AppleScript: 2.1.1/Script Debugger 4
Browser: Firefox 2.0.0.6
Operating System: Mac OS X (10.4)
Now I am having some slight issues with the two versions of my script. The original resolution issue is gone., but converting to outlines does not work.
One converts raster images to SWF and the other converts vector files. I am not sure if there is a better way to do this, but it is the only way I can find so far.
I have thought about setting up the SWF Presets in Illustrator, but am not sure if that will work any better. Any suggestions?
Here is the raster to SWF script:
copy text item delimiters of AppleScript to savedDelim
set text item delimiters of AppleScript to {":"}
set text item delimiters of AppleScript to savedDelim
set FileSample to choose folder with prompt "Choose an input folder."
set outputPath to choose folder with prompt "Choose an output folder. The input folder is suggested."
set folderName to name of (info for FileSample)
tell application "Finder" to set theFiles to files of folder FileSample whose name extension is in {"tif", "tiff", "eps", "ai"} or kind contains "tif" or kind contains "eps" or kind contains "ai"
repeat with oneFile in theFiles
tell application "Adobe Illustrator"
activate
open (oneFile as alias) with options {update legacy text:true} forcing CMYK without dialogs
tell front document
try
if locked of layer is true then
set locked of layer to false
else
set selected of every page item to true
end if
end try
export as Flash with options {convert text to outlines:true, generate HTML:false, version:8, preserve appearance:true, output resolution:150} to outputPath
close without saving
end tell
end tell
end repeat
tell application "Finder"
activate
display dialog "All input files have been processed." buttons "Ok" default button 1
end tell
Here is the vector to SWF script:
copy text item delimiters of AppleScript to savedDelim
set text item delimiters of AppleScript to {":"}
set text item delimiters of AppleScript to savedDelim
set FileSample to choose folder with prompt "Choose an input folder."
set outputPath to choose folder with prompt "Choose an output folder. The input folder is suggested."
set folderName to name of (info for FileSample)
tell application "Finder" to set theFiles to files of folder FileSample whose name extension is in {"eps", "ai", "ART1", "ART2", "ART3", "ART4"} or kind contains "Postscript" or kind contains "EPS" or kind contains "Illustrator"
repeat with oneFile in theFiles
tell application "Adobe Illustrator"
activate
open (oneFile as alias) with options {update legacy text:true} forcing CMYK without dialogs
tell front document
try
if locked of layer is true then
set locked of layer to false
else
set selected of every page item to true
end if
end try
export as Flash with options {convert text to outlines:true, generate HTML:false, version:8} to outputPath
close without saving
end tell
end tell
end repeat
tell application "Finder"
activate
display dialog "All input files have been processed." buttons "Ok" default button 1
end tell
Model: Dual 2.3GHz G5
AppleScript: 2.1.1/Script Debugger 4
Browser: Firefox 2.0.0.3
Operating System: Mac OS X (10.4)
I haven’t ever used the export to flash command so not sure if this will help you.
but couldn’t you convert to outline before you export with something like this:
tell application "Adobe Illustrator"
convert to paths (every text frame of document 1)
end tell
Pidge!
Thanks again for another simple solution! I was trying to do everything in the Export command, but forgot entirely about my 12 years as a graphic designer… Now that my head is out of my ass, I will try it tomorrow morning.
I tried it, and a few variations, but I only get this error, code 1230.
copy text item delimiters of AppleScript to savedDelim
set text item delimiters of AppleScript to {":"}
set text item delimiters of AppleScript to savedDelim
set FileSample to choose folder with prompt "Choose an input folder."
set outputPath to choose folder with prompt "Choose an output folder. The input folder is suggested."
set folderName to name of (info for FileSample)
tell application "Finder" to set theFiles to files of folder FileSample whose name extension is in {"eps", "ai", "ART1", "ART2", "ART3", "ART4"} or kind contains "Postscript" or kind contains "EPS" or kind contains "Illustrator"
repeat with oneFile in theFiles
tell application "Adobe Illustrator"
activate
open (oneFile as alias) with options {update legacy text:true} forcing CMYK without dialogs
tell front document
try
if locked of layer is true then
set locked of layer to false
else
set selected of every page item to true
end if
end try
set selected of every page item to true
convert to paths (every text frame of document 1) --Errors here...
export as Flash with options {convert text to outlines:true, generate HTML:false, version:8} to outputPath
close without saving
end tell
end tell
end repeat
tell application "Finder"
activate
display dialog "All input files have been processed." buttons "Ok" default button 1
end tell
Model: Dual 2.3GHz G5
AppleScript: 2.1.1/Script Debugger 4
Browser: Firefox 2.0.0.3
Operating System: Mac OS X (10.4)
copy text item delimiters of AppleScript to savedDelim
set text item delimiters of AppleScript to {":"}
set text item delimiters of AppleScript to savedDelim
set FileSample to choose folder with prompt "Choose an input folder."
set outputPath to choose folder with prompt "Choose an output folder. The input folder is suggested."
set folderName to name of (info for FileSample)
tell application "Finder" to set theFiles to files of folder FileSample whose name extension is in {"eps", "ai", "ART1", "ART2", "ART3", "ART4"} or kind contains "Postscript" or kind contains "EPS" or kind contains "Illustrator"
repeat with oneFile in theFiles
tell application "Adobe Illustrator"
activate
open (oneFile as alias) with options {update legacy text:true} forcing CMYK without dialogs
tell front document
try
if locked of layer is true then
set locked of layer to false
else
set selected of every page item to true
end if
end try
set selected of every page item to true
convert to paths (every text frame) --Errors here...
export as Flash with options {convert text to outlines:true, generate HTML:false, version:8} to outputPath
close without saving
end tell
end tell
end repeat
tell application "Finder"
activate
display dialog "All input files have been processed." buttons "Ok" default button 1
end tell
you don’t need the “document 1” part cause you’ve already told it your talking to it via the “Tell Front document” line
this is what i believe is causing you problems.