• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to search / filter objects by name in Layers panel?

Explorer ,
Sep 20, 2018 Sep 20, 2018

Copy link to clipboard

Copied

Is there any way exists for filter (via typing substring) list of all document objects in Adobe Illustrator Layers panel? For quick find and select objects with same word in name.

TOPICS
Scripting

Views

7.9K

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
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 23, 2018 Sep 23, 2018

Yes, possible with scripting.

Here you go:

// select_byPartOfName.jsx

// does not work with 'automatically' named text frame items

// https://forums.adobe.com/message/10636405#10636405

var aDoc = app.activeDocument;

var pI = aDoc.pageItems;

aDoc.selection = null;

    $.writeln(pI.length)

for (i=pI.length-1; i>=0; i--) {

    $.writeln(pI.name.match(/test/i))

    if (pI.name.match(/test/i) != null) {

        pI.selected = true;

        }

    }

select_byPartOfName.png

Votes

Translate

Translate
Adobe
Community Expert ,
Sep 22, 2018 Sep 22, 2018

Copy link to clipboard

Copied

As far as I can tell, the only way to accomplish this would be with a script. I did find one online, but it seems to be a work in progress. I'm not a scripting expert, but perhaps someone on this forum would be more adept in writing something like that. I'd find it helpful, as well!


Adobe Community Expert / Adobe Certified Instructor

Votes

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
community guidelines
Community Expert ,
Sep 23, 2018 Sep 23, 2018

Copy link to clipboard

Copied

Yes, possible with scripting.

Here you go:

// select_byPartOfName.jsx

// does not work with 'automatically' named text frame items

// https://forums.adobe.com/message/10636405#10636405

var aDoc = app.activeDocument;

var pI = aDoc.pageItems;

aDoc.selection = null;

    $.writeln(pI.length)

for (i=pI.length-1; i>=0; i--) {

    $.writeln(pI.name.match(/test/i))

    if (pI.name.match(/test/i) != null) {

        pI.selected = true;

        }

    }

select_byPartOfName.png

Votes

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
community guidelines
Explorer ,
Oct 16, 2018 Oct 16, 2018

Copy link to clipboard

Copied

Thanks for so short but very useful script! Will be good to have build-in object filter in Adobe Illustrator interface, for example in bottom line of Objects panel.

Votes

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
community guidelines
Community Expert ,
Oct 17, 2018 Oct 17, 2018

Copy link to clipboard

Copied

agree, it would be great to be able to customize the UI but it is not possible at the moment.

Votes

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
community guidelines
Explorer ,
Jan 20, 2019 Jan 20, 2019

Copy link to clipboard

Copied

Votes

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
community guidelines
Explorer ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

Can someone explain step-by-step to a scripting newbie how to use this? I was able to make the script file have it appear in the scripts file, but when I select it I get an error:

Error 1302: No such element / $.writeln(pI.name.match(/test/i))

So obviously I'm not using it right. It looks like the key is with the "test" in the code, but I don't really understand if this is a string or a variable or what. I tried changing "test" to a word that appeared in some layer names, but I still got that error (with the new string substituted for "test").
Can someone offer help here?

Votes

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
community guidelines
Community Expert ,
Jun 05, 2020 Jun 05, 2020

Copy link to clipboard

Copied

You are right.

 

It is a known bug. The change to the new forum software removed parts of code ( mostly the counter "i" )

 

Try this version:

// select_byPartOfName.jsx
// does not work with 'automatically' named text frame items
// https://forums.adobe.com/message/10636405#10636405

var aDoc = app.activeDocument;
var pI = aDoc.pageItems;
aDoc.selection = null;
for (i=pI.length-1; i>=0; i--) {
	if (pI[i].name.match(/test/i) != null) {
		pI[i].selected = true;
		}
	}

Votes

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
community guidelines
Adobe Employee ,
Sep 24, 2018 Sep 24, 2018

Copy link to clipboard

Copied

moved to Illustrator Scripting​

Votes

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
community guidelines
New Here ,
Mar 20, 2023 Mar 20, 2023

Copy link to clipboard

Copied

LATEST

I have a very good idea:

you could just open the svg in a text editor and then pattern search there. Cannot filter... but IntelliJ does the trick for searching with complex regexes

Votes

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
community guidelines