Hello,
I am trying to reference grouped items in illustrator by their actual value in the list via a variable but I get errors.
A script I found like this will work:
tell application "Adobe Illustrator"
set thisDoc to the current document
tell thisDoc
set plist to every group item
repeat with i in plist
set shapeSelection to every group item of layer "Shape Layer" of thisDoc
set position of i to {200, 200}
end repeat
end tell
But if I want to try and reference an individual group item in the plist, I get errors.
tell application "Adobe Illustrator"
set td to the current document
tell td
set plist to every group item
set itemcount to count of plist
set maxcolumns to 4
set maxrows to (itemcount div maxcolumns)
set remainder to (itemcount mod maxcolumns)
set pageitem to 1
set currentrow to 0
repeat until currentrow = maxrows
set currentcolumn to 0
repeat until currentcolumn = maxcolumns
set position of group item pageitem in plist to {(200 * currentcolumn), (200 * currentrow)}
set pageitem to (pageitem + 1)
set currentcolumn to currentcolumn + 1
end repeat
set currentrow to (currentrow + 1)
end repeat
end tell
end tell
Rather than using a repeat with i in plist, I want to control the layout of the “table” by referencing the current item number in the list through iterations.
The items in the document are also grouped, and need to be referred to as such (otherwise individual elements get moved instead).
Any help would be greatly appreciated.
Thanks.