Placing Items in Illustrator CS (to replace “Photoshop” layers)

So I have these Photoshop documents with multiple (in the hundreds) layers. EVERY layer within these compositions essentially corresponds to a separate (at least in name) individual image file “ for example I named the first layer “bookshelf.psd.” because the image came from another Photoshop file entitled bookshelf.psd . . . ect. ect.

Also there are several compositions that have many of the same layers (images). I say this because ultimately what I’m working towards is a way in which I can go back and change the original file and have those changes be updated in whatever compositions they might exist. I’ve finally accepted the fact that there’s no real way to do this in Photoshop (even with smart objects :frowning: ) So I’m moving the whole operation over to Illustrator for the time being.

Here’s my plan:

  1. Open the photoshop document in Illustrator (Converting it to an .ai file but still keeping all of the original layers as well as their names!)

That’s pretty much all I got so far.

What needs to happen next, is where I’m desperately in need of some AppleScript guidance. By going through each layer I need to replace the old Photoshop layer with a new “Placed” item taken from the original image file. That way should I choose to go back and edit anyone of these individual images in Photoshop, any changes will be automatically updated in my main composition(s) (now in Illustrator). What’s more, with Illustrator’s option to “replace” with the “Place”, the new item automatically takes the place (literally) of the old layer “ at least close enough for what I need. Because I painstakingly labeled each layer to the name of its original corresponding file (and these files are all located in the same folder) what I want isn’t imposable - but TEADIOUS!

I think (or am fairly sure) I can figure most of the logistics of automating the whole task with AppleScript but before that I need to overcome the central problem I’m having of getting Illustrator to Place a new item into the document, the way I want it to.

Here’s where I started

tell application “Adobe Illustrator”
set replacedItem to make new placed item in current document with properties {file path:imageFilePath}
end tell

  • I don’t need Illustrator do doing anything special to the place file OTHER then to put it in the same place and scale it to the dimensions (in theory) that illustrator gives its corresponding layer when importing the entire Photoshop document into Illustrator. It works no problem to manually “Place” item and check the “Replace” box. But so far the closest to that I can get with AppleScript is getting the new placed object in the same layer group. As of yet I haven’t figured out how to retrieve the necessary positioning and scaling info from each of the original imported layers to be able to just set the coordinates within the properties tag of the “make new placed item” command.

I was hoping to find a way to simply include the “replace” option from within the command - if it’s possible, I can’t seem to find any scripts out there that have included this option. I’m still SO new at AppleScript-ing to make much sense out of the scripting dictionary, but I’ve learned a lot just from reading these forums and thought I’d take a shot to see if there’s anyone out there who can help me with what I’m trying to do.