Beenden
  • Globale Community
    • Sprache:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티

Extracting unique identifier for illustrator layers

Community-Einsteiger ,
Jun 03, 2014 Jun 03, 2014

Hi All,

Multiple layers in an illustrator file can have the same name. So the layer name cannot be a unique identifier for layers. Is there a way to extract a unique identifier for layers through scripting? I saw that if the 'Identify Objects by' property (inside Preferences -> Units) is set to XML ID, all layer names, even identical ones are replaced by some unique ids. Can we extract these ids via scripting without manually changing the 'Identify Objects by' property. Basically, extraction of any unique identifier for illustrator layers would serve the purpose. I am really stuck with this and need help urgently. Any help would be highly appreciated.

Thanks in advance.

THEMEN
Skripterstellung
2.5K
Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Adobe
Neu hier ,
Oct 29, 2014 Oct 29, 2014

Hi I have just asked this same question Access XML_ID of pageItem/groupItem before seeing this one.

Did you ever find a solution?

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Community-Einsteiger ,
Oct 29, 2014 Oct 29, 2014

Hi Michael,

Unfortunately I never got the solution as to how we can access the XML ID. I resorted to generating by own id for the layers. It is not exactly an ideal solution but suffices my purpose. Though I would love to know if at all there is a way to extract the unique id .

Thanks.

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Ratgeber ,
Nov 02, 2014 Nov 02, 2014

Not sure if this is what your after, but under Preferences there is an option to "Identify Objects By: Object Name or XML ID"

I only just noticed it so not sure if it helps in any way

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Community-Einsteiger ,
Nov 03, 2014 Nov 03, 2014

Hello,

I was actually trying to access this unique id using Extendscript. That's where I was stuck as I could not find which property in the Illustrator DOM would give me the value for XML ID.


Thanks.

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Tapferer Held ,
Nov 04, 2014 Nov 04, 2014

Hi all, I am sorry to bring about gloom, but it is my opinion that the (Identify by Object Name or XML_ID) is purely for input purposes while you're using Illustrator to draw.  The preference controls how you can input new names (Unique name, no spaces, no start with number, etc) and makes changes to existing names to convert to the new preference.  The name is now in the format of an XML_ID, so your pageItem.name is still what reflects the object's xml id.

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Ratgeber ,
Nov 04, 2014 Nov 04, 2014
AKTUELL

When I found this I noticed it changed the name of the layers in the layers pallet.

I had not had a chance to test this with code.

If "use XML ID" is turned on then you are not able to name layers the same thing.

this in turn would follow through to your script using layer.name

for existing files you would need to fix names manually or...

I am sure it would be possible to Script.

eg. export SVG file and pull the layer ID's from that and rename the document layers accordingly. (may be a little tricky for sublayers, but top level layers should be straight forward)

Then as long as "use XML ID" is left on the files would not need this run again as you cannot use duplicate layer names.

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines