Copy link to clipboard
Copied
I have a document with several artboards in it and I want to select all so I run this:
app.executeMenuCommand("selectall");
Unfortunately, this seems to only select the artwork items and not the text.
Am I doing something wrong or is there a better way to select everything?
Thanks
Hi @Bernie5CFE
app.executeMenuCommand("selectall");
The above command is used to select the artwork, if you want to select the text inside the textframe, you need to select() method on textRange as below
var _textFrame = app.activeDocument.textFrames[0];
_textFrame.textRanges[0].select();
The above code will select first charcter of the first textframe of the document.
Thanks @Charu Rajput, you sent me in the right direction.
In the end I ended up doing this:
this.selectAll();
for ( var i = 0; i < app.activeDocument.textFrames.length; i++ ) {
app.activeDocument.textFrames[i].textRange.select(true)
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
go to layers, select the circle on the right, click to target everything including artboard.
Copy link to clipboard
Copied
It looks like the text has been outlined. Is that correct?
Can you please expand "Layer 1" so content can be viewed?
@innovative_adventurer5D56, That's a good way to manually select. I think @Bernie5CFE is wanting to do it in a script.
You can also try:
Copy link to clipboard
Copied
Hi @Bernie5CFE
app.executeMenuCommand("selectall");
The above command is used to select the artwork, if you want to select the text inside the textframe, you need to select() method on textRange as below
var _textFrame = app.activeDocument.textFrames[0];
_textFrame.textRanges[0].select();
The above code will select first charcter of the first textframe of the document.
Copy link to clipboard
Copied
Thanks @Charu Rajput, you sent me in the right direction.
In the end I ended up doing this:
this.selectAll();
for ( var i = 0; i < app.activeDocument.textFrames.length; i++ ) {
app.activeDocument.textFrames[i].textRange.select(true)
}