Hello All,
I have been digging through the MacScripter site for a few weeks now, and have found it a great tool for learning AppleScript. The community is great here, thanks for all the help already.
Before I begin with my problem, let me guide you to some files that may help with the solution.
https://www.dropbox.com/sh/8sxqwykpeo5f4rr/PleyQ3OTof
This should show 6 files total. 3 saved as selection sample1, and 3 saved as selection sample2. Thereās an .ai (Adobe Illustrator) file of each, a jpg, and a smaller jpg showing the layer and text frame breakdown of both ai files.
So, Iām trying to find out how to get AppleScript to set a selection to a particular region of my art board in Illustrator CS5. If you look at the files I linked via dropbox, I need to delete the 2 text frames towards the bottom right of the art board. Where it gets tricky (at least for me) is that this needs to be done in multiple files, and the position/control bounds/visible bounds of each text frame may vary slightly. Also, the names of each text frame may differ from file to file, so I canāt select a text frame by itās name. This is why I need to select every text frame that falls within a certian āregionā of the art board. At least, thatās all I can think of at this point.
I know you can set selection to text frames in an EXACT position, with EXACT control bounds, or using EXACT visible bounds. EXAMPLE:
tell application "Adobe Illustrator"
tell current document
set selection to every text frame whose position is equal to {478.5, 80.6767578125}
end tell
end tell
tell application "Adobe Illustrator"
tell current document
set selection to every text frame whose control bounds is equal to {472.5, 87.6865234375, 542.5, 11.4189453125}
end tell
end tell
tell application "Adobe Illustrator"
tell current document
set selection to every text frame whose visible bounds is equal to {478.5, 81.6865234375, 541.5, 12.4189453125}
end tell
end tell
If you run any of those 3 scripts on either of the .ai docs in the dropbox link, it works on the 1st sample doc, but not the 2nd doc. The closest I can think of to what I need (but doesnāt work :/) is:
tell application "Adobe Illustrator"
tell current document
set selection to every text frame whose visible bounds is contained by {478.5, 81.6865234375, 541.5, 12.4189453125}
end tell
end tell
What I am trying to do in the last section of AppleScript I listed, is select everything within the bounds of certian coordinates, rather than select everything that is EQUAL to the coordinates. I think part of my problem is that āis contained byā is used to find a file in a folder. I donāt know what else to use, if there is anything. Any help is appreciated, and thanks in advance!