Skip to main content
Inspiring
July 1, 2019
Answered

Adding Tags to document

  • July 1, 2019
  • 3 replies
  • 2388 views

Hello,

I try to add tags to my active document but I receive an error message :

"Cannot apply a tag to a document"

Does anybody success to add tags to a document ?

Thanks

This topic has been closed for replies.
Correct answer CarlosCanto

kopaacabana  wrote

Does anybody success to add tags to a document ?

Thanks

no, you can only add tags to objects. You might want to try using XMP to add metadata to the document instead.

from the Reference

Tag

A label associated with a specific piece of artwork. Tags allows you to assign an unlimited number of

key-value pairs to any page item in a document.

3 replies

Ten A
Community Expert
Community Expert
July 1, 2019

In this case, You can use XMP Meta Data as CarlosCanto say.

You can reference below.

Extend_Script_experimentals/XMPtool.jsx at master · ten-A/Extend_Script_experimentals · GitHub

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
July 1, 2019

kopaacabana  wrote

Does anybody success to add tags to a document ?

Thanks

no, you can only add tags to objects. You might want to try using XMP to add metadata to the document instead.

from the Reference

Tag

A label associated with a specific piece of artwork. Tags allows you to assign an unlimited number of

key-value pairs to any page item in a document.

Inspiring
July 2, 2019

Thanks for your response.

When I visit this doc reference : Adobe Illustrator CS6 Type Library JS: Document, class Document have tags as propreties, so why can't we add/use tags on document, it's very strange !!!!

CarlosCanto
Community Expert
Community Expert
July 3, 2019

yeah, it's a little confusing. The tags are added to objects, but they're also stored in the document. So if you have Object 1 with 1 tag and object 2 with 3 tags, in total the document will report having 4 tags. But tags are attached to objects not to the document itself.

Lumenn
Inspiring
July 1, 2019

Hey, can you show us your code ?

Here is some documentation for tags, maybe it will help.

Tags — Illustrator Scripting Guide 0.0.1 documentation