Scripting Illustrator using AppleScript - how to place a PDF file in a specific position and layer
Hello -
I am trying to automate my image creation pipeline and would like to program up the equivalent of paste (and scale) in illustrator. I am a newbie to scripting, but chose to use AppleScript, and I find the documentation far too sparse to be helpful.
My understanding is that I should be able to do this using either group item or placed item. However, if I try
set imageRef to make new placed item in imageLayer with properties {file path: imageFileName}
where imageLayer is defined using
set imageFileName to POSIX file "testFile.pdf"
while imageLayer is defined via
set imageLayer to layer 1 of docRef
However, when I try to execute the script, I get the following error message: "Adobe Illustrator got an error: Can’t make some data into the expected type."
Any advice would be very much appreciated! Also, if anyone could point me to the reference to the property fields of different objects, then that would also be very helpful (for example, where can I find the property fields for placed items or group items?
Thanks,
Carl