Copy Object Name ot
Hi folks,
I found a script on this forum, dating all the way back to 2012, from someone named JETalmage, which should copy an object's name to its note, to allow the use of Action > Select Object to multiselect it.
This doesn't appear to do anything in Adobe Illustrator 2019, however.
This is the original script:
//Script Start
//JET_X_SetNoteToName.jsx
var docRef=app.activeDocument;
var docObjects=docRef.pageItems;
for (i=0;i<docObjects.length;i++){
var currObj=docObjects;
currObj.note=currObj.name;
}
//Script End
It runs, but nothing happens. If I change line 13 to look for 'typename' instead of just 'name', then it populates the Note field with the type of object ('PathItem', 'TextFrame'), so appears to be working as intended for that function.
currObj.note=currObj.typename;
This would suggest to me that the acceptable syntax for PageItems has changed and no longer allows direct reference to 'name'. Having never used a version of Illustrator before 2019, there's a bit too much time between then and now for me to track all of the changes to the syntax which might be responsible, and hence I can't work out what to do to resolve this.
It's worth noting that my actual issue would also be resolved by directly selecting all of the items of a given name via scripting as well, though it would be useful for such a script to allow the selection of a string each time, to give it some versatility.
For more detail about my problem, I have imported a layout from Microsoft Publisher, and the file within Illustrator is engorged with clipping masks and unnecessary blank boxes as a result. I can release all of the clipping masks and ungroup to get everything on a single layer, but I am left with hundreds of empty boxes named '<Type>' which I want to be able to select all at once and delete.
Thanks in advance for any help you can provide. I've got a fair amount of programming experience, but I've not used Javascript in some 20 years so I'm a bit lost, particularly with this non-standard one Adobe are using.
