PTC ALD in Arbortext Styler > Components of Documents and Templates > Tags > Managing Tags
Managing Tags
There are two options for managing tags in PTC Arbortext Layout Developer:
From JavaScript
The JavaScript methods are used less often as prepared templates already contain most of the tags. They can be employed to create tags during formatting to store text, graphics, or other content.
Interactively (PTC Arbortext Layout Developer— Desktop product only)
When working to build template components, the interactive methods for creating, deleting, renaming, and handling tags are very important. You must be comfortable with these tools.
JavaScript Tag Management
The Formatting Object Model provides the fContent object and the fTag object. Many of the content objects inherit fTag, which provides access to the same properties and methods.
The fContent object has a number of properties and methods that allow users to manage the tags in a document or template:
fContent.tags is an array of all the tags in the current document. The tags are not sorted by type in this array.
fContent.functions is an array of the JavaScript function tags in the document and can be used to call a specific JavaScript function, such as:
where myFunction is the name of the JavaScript function tag you want to call.
fContent.streams, fContent.rasters,, fContent.controls, fContent.layergroups, fContent.layers, fContent.frames, fContent.indexes, fContent.footnotes, fContent.accolades, fContent.publishes, fContent.colors provide lists of specific types of tag in the document
The fContent object includes get and create methods for the different types of FOM objects represented by tags. It also includes createTag(), deleteTag(), and copyTag() methods.
The fTag object is the top-level object. Many other content objects in the FOM inherit fTag. The fTag.type property specifies the tag’s type — change its value to change the tag type.
fTag also has some methods to manage the tag:
fTag.copyTag() — copies the current tag to another
fTag.deleteTag()— deletes the current tag
fTag.renameTag()— renames the current tag
Interactive Tag Management
The PTC Arbortext Layout Developer— Desktop product provides some tools to manage tags. The main feature is the tag browser that is available through the Document > Tags > Browse tags menu item. This window enables you to view all the tags within the current document or template and perform some basic tasks:
List tags by namespace or by type
It is often useful to list by namespace first, particularly in the Arbortext Styler integration. All tags created from the .style stylesheet belong in nested namespaces.
Search for a tag
Click in the tag name field and use *tag_name* to find all tags that contain the name fragment in their name.
Open tags for edit
This displays the selected tag into a tag edit window.
Delete or rename tags
The tag browser also provides information on the selected tag. The panel to the right shows the content of the tag (or a preview of the graphic tag). The Info tab shows the information available for the selected tag, including graphic information and content types.
Tags can also be managed through the macro bar, PTC Arbortext Layout Developer’s command line. Press F9 to invoke the macro bar. Enter macros in the forms shown in these examples to carry out common tasks for tags:
ttagmk “tag_name.ex” — create a tag with the specified name and extension
The tag name can include namespace prefixes. If a tag extension is not provided, a .st type tag is created.
ttagdel “tag_name” — delete the named tag
ttagren “myTag” “myNewTag” — rename the tag myTag to new name myNewTag
ttagren “myTag” “.ex” — change the extension of tag myTag to .ex
ttagedit “myTag” — open tag myTag in a new tag editor window
“tagName” — open tag myTag in the UI’s yellow bar
The tag edit window is a modeless tag edit window that allows the edit of multiple tags concurrently. It also includes a run option to execute scripts. Note that the fFormatting object is not available when running JavaScript in this way. Any calls to that object will fail.
Refer to the User’s Guide in the PTC Arbortext Layout Developer Help Center for information about the PTC Arbortext Layout Developer UI.