Manage Snippets

Modify and delete Local snippets with the Manage Local Snippets dialog.

Each snippet is stored in a separate FrameMaker document and the information about that snippet is stored as the snippet’s filename. The Manage Local Snippets dialog displays a list of all Local snippets in the following format:

  SNIPPET NAME - <ELEM> (Esc, KEYS) [M] -L-

Where “SNIPPET NAME” is the name of the snippet and “ELEM” is the name of the snippet’s root element. If you’ve assigned a shortcut, that string will be shown where “KEYS” is indicated, and if this snippet has been added to the context menus a “[M]” is added to the listing. Each snippet is identified with a “-L-” or “-R-” indicating that it is stored in either the Local or Remote snippet folder.

When you select an item from the list, these values are added to the associated fields in the dialog box. The root element cannot be changed without recreating the snippet (and renaming the file). To change the snippet name, shortcut keys, or context menu usage, modify the values and choose the Save button. If you want to make edits to the content of the snippet, choose the Edit File button and the associated snippet file will open. To delete the snippet, choose the Delete button.

If you choose to edit the content of a snippet file, you’ll see that it is an “invalid” structured document. In the structure view window you’ll see the elements and structure, but it will all be colored red indicating that it is invalid. This is by design and does not indicate a problem. You are free to modify the elements, attributes and formatting in this snippet file. When done editing just save and close the file. The next time you use that snippet the edits will appear in the inserted snippet.

You can edit the names of the snippet files through a file system browser (like Windows Explorer), but you must use care and follow the naming convention required by the plugin. Each snippet file uses the following tilde-delimited naming scheme, and uses the .fm-snip file extension:

  ELEM~SNIPPET NAME~KEYS~1.fm-snip

Each “field” of the snippet file name is separated with the tilde (~) character. The file name starts with the root element name, then the snippet name; these two values are required and must be unique. If this snippet has an associated shortcut key sequence, those characters are next. At the end of the file name (before the file extension) is a number, 1 or 0, which indicates if this snippet name is added to the context menu (1 means it is added, 0 means it is not added). If a snippet file does not follow this naming scheme, a message is displayed in the FrameMaker Console window, and that snippet is skipped.