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.
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;
}
}
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!
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;
}
}
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.
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.
Copy link to clipboard
Copied
I create a feature request about this: Implement quick filter by object name in Illustrator Layers panel – Adobe Illustrator Feedback - let's vote!
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?
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;
}
}
Copy link to clipboard
Copied
moved to Illustrator Scripting​
Copy link to clipboard
Copied
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