Register

Autocomplete Mentions

An Add-on Module for Foundry Virtual Tabletop

Author: phloro Project Source: Project URL Versions 11+ (Verified 11.315) Last Updated 1 year ago

Quickly insert cross-references to actors, items, scenes, roll tables, and journals inside any editor box in Foundry without needing to find them, drag & drop, or remember the precise spelling/capitalization.
 
Feature requests?

Features 

  • Facilitate your world building by rapidly cross-referencing other parts of your world as you write, without needing to stop to drag & drop or even create a new element.
  • Insert references to actors, items, journals (and pages), scenes, and roll tables (including in Compendia).
  • Quickly create new documents (actors, etc.) with a couple of keystrokes, simultaneously inserting a reference to the newly created element into the editor.
  • Inserts references as pure UUID so that the link text updates when the name of the referenced item changes

How it works

The basics

  • Typing @ in any* Foundry VTT editor will pop open a context menu where you can select the type of document.
  • Select the document type by using the up/down arrows and enter key, typing the first letter as indicated, or clicking with the mouse.
  • You'll then get a list of the available documents of that type.  Start typing to filter the list.  Filtering is Foundry's full-text search (which currently appears to only search the name field, but finds matches in any part of the field - not just the start.  For example, 'j', 'jo', and 'oe' would all be matches for an actor named 'Joe'). Searching is not case sensitive.
    • If you highlight text in the editor before pressing @, that text will become the initial filter.
  • You can select the document you want with the arrow/enter keys or clicking with the mouse. 
  • Backspace will delete characters from the search string, and when the search string is empty, it will also go back to the prior menu. 
  • The Escape key will close the menu without inserting a reference.  Pressing escape immediately on the first menu after typing '@' will insert a '@' character in the editor for scenarios where you need that character.

* Note: Supports the new (standard) ProseMirror editor, as well as TinyMCE - send me a feature request if you need a different one

 

Creating new documents

  • You can use the "Create" option to quickly create a new document while simultaneously inserting a reference to it.
  • The current filter will become the default name of the new document.  Unfortunately, it can't currently be edited.  To use it as is, simply leave the name field in the dialog alone.  To make a change, just put in your desired value.
  • When creating a new document of the same type as the one being edited (for example, you're linking to another Actor related to the one you are editing), the new document will be put in the same compendium and folder as the one being edited.

Inserted text

  • Note that links will be inserted as just UUID references, which means that when you view the text (not in edit mode), you'll see the current name of the referenced document - even if it has changed since the link was inserted. If you want to have the link text set permanently, regardless of future changes to the document name, you can manually add the text. For example, you might get a reference like: `@UUID[Actor.E6azrOSJJfSxvgty]`. By adding text in curly brackets immediately afterward (ex. `@UUID[Actor.E6azrOSJJfSxvgty]{Joe}`), you can make the link text read "Joe", even if you change the Actor's name in the future, while ensuring the link continues to work.
  • Any highlighted text in the editor when you press @ will become the label on the link - even if you subsequently change the filter.  For example, if you highlight 'her cousin' and press @, then press A to select 'Actors', you'll see a list filtered by the text 'her cousin'.  If you backspace to remove that text and then pick an actor named 'Joe', when you insert it you will get a link like `@UUID[Actor.E6azrOSJJfSxvgty]{her cousin}` that (when you close the editor) says 'her cousin' but links to Joe.

 Journal entries

  • In the case of journal entries, once you pick the main entry, you'll get a subscreen where you can search for and select a specific page to create/refer to, or you can pick the option to point to the overall journal entry.

Number of results

  • There is a module setting to set the maximum number of search results that will show at one time.  If you set it really high, I take no responsibility for failures of the UI to accomodate. :)

Compendia

  • There is a module setting to specify a list of compendia to be searched. 
  • If the document being edited is in a compendium, then compendia will be searched first for any results.  If it is not, then compendia will be searched last (and thus any matching results will only be shown if there aren't sufficient results in the world data).

Issues?

If you believe you found a bug or would like to post a feature request, head over to the module's Github repo and open a new issue.
 

Support

I'm happy to do this for free, as I primarily work on things I like to use myself.  But if you'd like to buy me a root beer, I love knowing that people are using my projects and like them enough to make the effort. It's really appreciated!  

Credits

Autocomplete Mentions is the result of the effort of many people (whether they know it or not). Please refer to CREDITS.md for the full list.

Categories

Available Versions

  1. Version 1.1.0

    11 months, 3 weeks ago
    Foundry Version 11+ (Verified 11.315) Manifest URL Read Notes
  2. Version 1.0.1

    1 year ago
    Foundry Version 11+ (Verified 11.315) Manifest URL Read Notes
  3. Version 1.0.0

    1 year ago
    Foundry Version 11+ (Verified 11.315) Manifest URL Read Notes
  4. Version 0.0.8

    Foundry Version 11+ (Verified 11.315) Manifest URL Read Notes