How to select non-native artwork with script?

Explorer ,
Aug 07, 2020

Copy link to clipboard

Copied

How does Illustrator use scripts to select all non-native artwork? Thank you

TOPICS
Scripting

Views

122

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

1 Correct Answer

Adobe Community Professional , Aug 07, 2020
Ton Frederiks Adobe Community Professional , Aug 07, 2020
There was a post (which is now a ghost) about it. I believe Carlos Canto made this. // select non-Native objects // https://forums.adobe.com/thread/1886524 if (app.documents.length > 0 ) { var idoc = app.activeDocument; var NonNativeItemsCount = idoc.nonNativeItems.length; if (NonNativeItemsCount>0) { for (i=0; i<NonNativeItemsCount; i++) { idoc.nonNativeItems[i].selected = true; } alert('there are ' + NonNativeItemsCount + ' non-Native items'); } else alert('there are no non-Native items'); }

Likes

Translate

Translate
Jump to answer Jump to answer
Enthusiast ,
Aug 07, 2020

Copy link to clipboard

Copied

What type of item is your non-native artwork?  Both placedItems and rasterItems have "selected" properites, which when assigned "true", select the item. 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Aug 07, 2020

Copy link to clipboard

Copied

There was a post (which is now a ghost) about it. I believe Carlos Canto made this.

// select non-Native objects
// https://forums.adobe.com/thread/1886524


if (app.documents.length > 0 ) {
var idoc = app.activeDocument;
var NonNativeItemsCount = idoc.nonNativeItems.length;
if (NonNativeItemsCount>0) {
for (i=0; i<NonNativeItemsCount; i++) {
idoc.nonNativeItems[i].selected = true;
}
alert('there are ' + NonNativeItemsCount + ' non-Native items');
}
else
alert('there are no non-Native items');
}

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
lengxiaomo AUTHOR LATEST
Explorer ,
Aug 08, 2020

Copy link to clipboard

Copied

thank you for your help

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more