Select All using AppleScript
Copy link to clipboard
Copied
Explore related tutorials & articles
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Since this answer is utterly unhelpful when there are multiple versions of the Illustrator AppleScript Reference Guide, here is the answer for future reference:
set the selection to every page item of current document
Copy link to clipboard
Copied
I don't script in AppleScript, but I noticed a much more efficient method for selecting all objects in the JavaScript language. It looks like it should work for AppleScript, too.
Basically, set the "has selected artwork" property of each layer to true.
There are usually many fewer layers than objects, so looping through all layers is much quicker than looping through all PathItems.
Not vouching for syntax here, at all; I imagine it will look something like this:
tell application "Adobe Illustrator"
set has selected artwork of (every layer of document 1) to true
end tell
The more brute force method probably looks something like this:
tell application "Adobe Illustrator"
set selected of (every page item of current document) to true
end tell
I would be curious to hear whether this works in AppleScript.
Copy link to clipboard
Copied
Both of these work your syntax is fine. The layers method is fractionally quicker but I would consider this to be the more brute force method.
This will move all items even if they are locked!!!
tell application "Adobe Illustrator"
set has selected artwork of (every layer of document 1) to true
translate selection delta x -1000 delta y -1000
end tell
This will fail and error if there are locked page items
tell application "Adobe Illustrator"
set selected of (every page item of current document) to true
translate selection delta x 1000 delta y 1000
end tell
Copy link to clipboard
Copied
Muppet Mark :
I have tried your first script. Works fine but AI returns an error if the layers are locked.
(i am using CS4)
Copy link to clipboard
Copied
Does anyone have any idea how to select all text frames in a document? I want to be able to copy them to a new document.
Copy link to clipboard
Copied
Do you need to do this with script? If selecting just the 'Text Fames' is all you need to do then this can be done in the GUI? If you need script to do this and other stuff to then post which scripting language you want to do it in… (it helps)…
Copy link to clipboard
Copied
Thanks for the lead guys. I worked on GUI scripting and came up with this
tell application "Adobe Illustrator"
activate
end tell
tell application "System Events"
tell process "Adobe Illustrator"
tell menu bar 1
tell menu bar item "Select"
tell menu "Select"
tell menu item "Object"
tell menu "Object"
click menu item "Text Objects"
end tell
end tell
end tell
end tell
end tell
end tell
end tell
I noticed that Events and Replies in the AS Editor wrote it differently:
tell application "Adobe Illustrator"
activate
end tell
tell application "System Events"
click menu item "Text Objects" of menu "Object" of menu item "Object" of menu "Select" of menu bar item "Select" of menu bar 1 of process "Adobe Illustrator"
end tell
Copy link to clipboard
Copied
A bit of GUI scripting may be the answer here.
tell application "Adobe Illustrator"
activate
end tell
tell application "System Events"
tell process "Adobe Illustrator"
tell menu bar 1
tell menu bar item "Select"
tell menu "Select"
click menu item "All"
end tell
end tell
end tell
end tell
end tell

