Highlighted

How to select non-native artwork with script?

Community Beginner ,
Aug 07, 2020

Copy link to clipboard

Copied

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

Adobe Community Professional
Correct answer by Ton Frederiks | Adobe Community Professional

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');
}

TOPICS
Scripting

Views

86

Likes

Translate

Translate

Report

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

How to select non-native artwork with script?

Community Beginner ,
Aug 07, 2020

Copy link to clipboard

Copied

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

Adobe Community Professional
Correct answer by Ton Frederiks | Adobe Community Professional

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');
}

TOPICS
Scripting

Views

87

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 07, 2020 0
Engaged ,
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
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 07, 2020 0
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
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 07, 2020 2
Community Beginner ,
Aug 08, 2020

Copy link to clipboard

Copied

thank you for your help

Likes

Translate

Translate

Report

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