Skip to main content
Participating Frequently
July 21, 2021
Question

Why doesn't symbol name come in when dragging to asset export panel?

  • July 21, 2021
  • 2 replies
  • 381 views

This seems obvious yet I can't find a batch workaround or script.

 

The current process is unnecessarily painstaking: 

1. drag symbols to asset export panel (eg. an icon library could have hundreds and multiple colour ways)

2. find symbol (one-by-one)

3. copy symbol name

4. find matching asset (one-by-one)

5. paste into asset name

6. repeat!


I can understand it must be called something like "Asset 1" if the artwork is not a symbol, but when dragging a named symbol name into asset export panel, the default surely should be match the symbol name.

 

Good news for Adobe is that they already have a solution!

 

Integrate the "Batch rename" feature from Bridge allowing "number sequencing" and the life-saving "string substitution" here like in Bridge also would make sense. 

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

CarlosCanto
Community Expert
Community Expert
July 21, 2021

the problem is the Symbol Item's name (or lack of it), for a strange reason, the "name" you see in the Layers panel is not the Symbol Item's name, it's the actual Symbol's name. So as far as Javascript is concerned, the symbols you dragged to the artboard are NOT named. 

 

If you explicitly name your Symbol Items then you'll have no problem, the Assets would be named accordingly, but you're back to square one, naming your symbol items is the same as naming your assets.

 

try this script, select one or more symbol items in your artboard before running.

// add selected symbol items to the Assets panel and name them accordingly
// carlos canto - 07/20/2021
// https://community.adobe.com/t5/illustrator/why-doesn-t-symbol-name-come-in-when-dragging-to-asset-export-panel/td-p/12190183

function main() {
    var idoc = app.activeDocument;
    var sel = idoc.selection;
    
    var asset;
    
    for (var a=0; a<sel.length; a++) {
        asset = idoc.assets.add(sel[a]);
        if (sel[a].typename == "SymbolItem") {
            asset.assetName = sel[a].symbol.name;
        }
        else {
            if (sel[a].name != "") {
                asset.assetName = sel[a].name;
            }
        }
    }
}

main();

Participant
March 13, 2024

It's 4AM and I was struggling with the naming of 25 symbols I created for brand logo variants of different formations and colors.

Volcanicc, Can't thank you enought for starting this thread!

Carlos! I'll find you! *inserts meme gif* and I'll kiss your hands for creating this script!!😭😭😭

I CAN SLEEP NOW!