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

How to edit Symbol

Explorer ,
Jan 02, 2011 Jan 02, 2011

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.

TOPICS
Scripting
635
Translate
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
Guru ,
Jan 03, 2011 Jan 03, 2011

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…

Translate
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 17, 2011 Jan 17, 2011
LATEST

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
}

Translate
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