I’m trying to automate a process that we do quite frequently. The script I have so far works until I try to make two rectangles into a compound path. I don’t know if this is allowed or not. The last line of the code gives an error: “Adobe Illustrator CS got an error: requested property not available for this object”. I have tried several different ways to word this. Help is appreciated! Thank you.
tell application "Illustrator CS"
activate
set docref to make new document with properties {width:684, height:1296, color space:CMYK}
set this_doc to current document
make new spot in this_doc with properties {name:"Proof Blue", color:{cyan:100, magenta:80, yellow:30, black:5}}
make new layer in current document with properties {name:"Artwork"}
make new layer in current document with properties {name:"Proof"}
make new layer in current document with properties {name:"Frame"}
delete layer "Layer 1" of current document
tell current document
set pathRef to make new rectangle in layer "Frame" with properties {name:"Fram", position:{18, 1278}, width:{196.704}, height:{329.976}, note:"square", fill color:{class:spot color info, tint:50.0, spot:spot "Proof Blue"}, stroke width:0.0, stroke color:{class:no color info}}
set pathRef to make new rectangle in layer "Frame" with properties {name:"Fram2", position:{31.5, 1260}, width:{169.776}, height:{271.512}, fill color:{class:no color info}, stroke width:0.25}
set item_ref to {path item "Fram2" of docref, path item "Fram" of docref}
set selection to item_ref
set item_ref of this_doc to compound path item
end tell
end tell