Script for Quark to open doc in Illustrator

I’m trying to write a script for QuarkXpress to select all illustrator EPS files in a document and open them up in Adobe Illustrator CS…and then I need to delete all unused color swatches and resave the file

So far, I’m able to tell Quark to search the document for the image type, but I keep getting errors when it tries to tell Illustrator to open the file

This is my first script trying to link applications together, and I guess I’m not advanced enough

Any Ideas?

You aren’t actually telling quark to open a file in Illustrator. You should be telling Quark to get a list of the file paths of each image. Then you can pass that list on to an illustrator tell block and have it open each one, delete the swatches and resave.


tell application "QuarkXPress™"
	set listOfFiles to file path of every image of document 1 whose file type is EPS picture as list
end tell

tell application "Illustrator CS"
 repeat with theFile in listOfFiles
  open file theFile
   -- put your delete swatches code here
 end repeat
end tell

HTH -john

You might want to check the creator type of the file before opening it in Illustrator to weed out any Photoshop EPS files.