ILS CS Script for 5000+ files! (for the love of "Jebus"... help!)

Hello all,

i am not a programmer, nor do i know any applescript, hence my reason for posting this on this site. so let me get to my issue:

i have 5000 files (pdf and a few eps formats) which i need to convert to .eps. there is no “batch function” in illustrator cs1 that will allow me to choose the source + destination folder. on top of this, i also need to run an action which will resize the art in everyfile.

here is my need:

locate source folder
choose destination folder
have ILS CS open up all files in source folder (1 by 1)
once open have ILS CS run the action i want (action name “1” from set “sexy”)
have the ILS CS (or the apple script itself) export the now modified doc as a “legacy eps, ver 9” to destination folder. below you will see some of the settings i would like to use when exporting the eps file:

{class:EPS save options, compatibility:Illustrator 9, preview:color Macintosh, embed linked files:FALSE, include document thumbnails:FALSE, embed all fonts:FALSE, CMYK PostScript:true, PostScript:level 2}

close open doc without saving over original
repeat the process from the begining with the next doc.

i have taken a shot in editting a couple scripts i found on this site myself, but since my scripting knowledge is pathetic (and i am being kind to myself say that :), i really need some professional help from any of you outhere. so please,… help me!

if there is anything any of you may need, please let me know and i will be happy to provide you more info.

thanks,

henry

pixelnovae,

First you can start by doing something like this,

tell application "Finder"
	set sourceFolder to choose folder with prompt "Select the folder with files for conversion."
	set destFolder to choose folder with prompt "Select the destination folder."
	set fileList to every file of folder sourceFolder as alias list
	set fileCount to count folder sourceFolder
	if fileCount is not 0 then
		repeat with aFile in fileList
			set fName to name of aFile
			set newFilePath to destFolder & fName as string
			tell application "Illustrator CS"
				activate
				open aFile
				-- this is an action set up in AICS. You have to make sure that your names from your actions are EXACTLY the same as in your script. The first name is the action and the second name is the action set.
				set selection to path item 1 of current document
				do script "1" from "sexy" without dialogs
				save current document in file newFilePath as eps with options {class:EPS save options, compatibility:Illustrator 9, preview:color Macintosh, embed linked files:false, include document thumbnails:false, embed all fonts:false, CMYK PostScript:true, PostScript:level 2} with replacing
				close current document saving no
			end tell
		end repeat
	end if
end tell

Note that I had Illustrator make a selection to perform an action on. I just set this as the first path item. If all items need to be changed you may need to count every item (path and text) and then loop it to peform your action. In trying to apply actions by selecting every page item I have had problems with the action not being performed on everything especially if it contains text and path items.

Hope this helps.

I REALLY DONT KNOW HOW TO THANK YOU!!!.. BUT

THANK YOU!!!

(paypal account?.. amazon wish list?,… seriously, let me know)

you made the task so easy for me.

thanks PreTech!!

henry

Pixelnovae,

A million dollars in small unmarked bills would be fantastic!:smiley:

Glad I could help!

PreTech

Macscripter.net…building good karma since ______ (Ray insert launch date here)

heheh,…

karma is all good! thanks to you guys!!!

in all seriousness, i support sites that give back to their users. have not done a lot of exploring here, but if the site has a donations page, then it is always nice to give something back. :smiley:

thanks again you guys.