Hi, can anyone help please?
We have recently upgraded our Adobe Illustrator to version 2019 and I am trying to get all our scripts working on the new version.
There is one issue however that I just can’t get passed.
tell application "Adobe Illustrator"
tell document 1
set x to group item 1 --assume one exists on an otherwise empty document
repeat 10 times
duplicate x
end repeat
set xx to count of every group item
end tell
end tell
This script will return a result of 1. Which or course is wrong.
It looks like Illustrator is not updating it’s layers and shows only one one group item until you interact with it, then 10 more pop up.
Is there a way of forcing Illustrator to update itself so the script works correctly and returns the correct number of groups?
P.S. Have tried the same thing with path items but this works OK.
Thanks
Tim
Try addressing them by layer:
tell application "Adobe Illustrator"
tell document 1
set x to group item 1 --assume one exists on an otherwise empty document
repeat 10 times
duplicate x
end repeat
set xx to every group item of layer 1 --> {group item 1 of layer 1 of document 1, group item 2 of layer 1 of document 1, group item 3 of layer 1 of document 1, group item 4 of layer 1 of document 1, group item 5 of layer 1 of document 1, group item 6 of layer 1 of document 1, group item 7 of layer 1 of document 1, group item 8 of layer 1 of document 1, group item 9 of layer 1 of document 1, group item 10 of layer 1 of document 1, group item 11 of layer 1 of document 1}
end tell
end tell
Yes, that works.
I’ll include the layer address in my scripts and we should be good to go again.
Not sure what happening with the new version that needs this… but…
Thanks Shane.
This also works:
tell application "Adobe Illustrator"
tell document 1
set x to group item 1 --assume exists on an otherwise empty document
repeat 10 times
duplicate x
end repeat
set selection to {}
set xx to count of every group item
end tell
end tell
The line “set selection to {}”, seems to wake up Illustrator and it returns the correct result.
But, not an ideal solution.
Thanks
Tim