(illustrator scripting) how to release objects to layers(sequence) but retain object's name?

Posted by Eugene on Stack Overflow See other posts from Stack Overflow or by Eugene
Published on 2010-12-31T02:44:25Z Indexed on 2010/12/31 2:54 UTC
Read the original article Hit count: 200

Filed under:
|
|

Hi, I've asked the same question to adobe scripting forum.
but seems there are not many forum users there, and I'm asking the same question here.

I was writing my first illustrator script to export all layers to png files with layer structure converted to file structure.

I found there are many layers that my script can't detect and found out that they are not actually layers but objects(or groups).
Found a layer menu (release to layers), but doesn't quite solve the problem perfectly.

initially I have this

  • layer 001
    • object 01
      • object 1
      • object 2

release to layers(sequence) on object 01 gives

  • layer 001
    • layer 91(whatever the layer number illustrator gives when release to layers are performed)
    • layer 92
      • object 1
    • layer 93
      • object 2

now I need to convert them to (so that layer can retain the name of the object)

  • layer 001
    • layer 01
    • layer 1
      • object 1
    • layer 2
      • object 2

I have hundreds of layer 001, and couple thousands of object 01, and wonder if anything can be done with script to do this...

If it's possible to detect object in a script, I could rewrite the 'release to layers' functionality in script maybe.

Any help would be greatly appreciated.

© Stack Overflow or respective owner

Related posts about script

Related posts about layer