Copy link to clipboard
Copied
What is the process to edit a Symbol using Javascript? I use a Symbol in a document, creating a SymbolItem. That SymbolItem references a Symbol that was used to display this instance. I would like to look at the components from which the Symbol is constructed. If it were a GroupItem, I could use the groupItems to see all the components that make up the group, but I can't do that with a Symbol.
Copy link to clipboard
Copied
You will find if you search the forum that you have no direct access to the art contents of symbols… You will need to work around duping to another doc then breaking the link…
Copy link to clipboard
Copied
Here is the code to view the components of a symbol:
function unlinkSymbol(mySymb){
var symbLayer=findOrCreateLayer("SymbolsTemp-----")
var dupSymbol=mySymb.duplicate() // Duplicate the symbol
symbLayer.visible = true // Layer must be visible and unlocked
symbLayer.locked = false
symbLayer.symbolItems.add(dupSymbol) // Place duplicate symbol on symbLayer
dupSymbol.remove() // Break the link
var myGroup = symbLayer.groupItems[symbLayer.groupItems.length-1]
myGroup.name = mySymb.name // Name the group same as the original
symbLayer.visible = false // Hide the layer, delete it later
return myGroup
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now