Skip to content
Michael Starke edited this page Dec 7, 2018 · 14 revisions

Autotype and Global Autotype are two important features of KeePass and MacPass.

Autotype

Autotype simulates keystrokes to enter text into applications. This concept makes it possible to enter account credentials in web forms, type passwords into terminals or enter text into an input of virtually any application. For example, you can use Autotype to enter your username and password in the App Store app but also on www.icloud.com. Autotype is invoked by clicking Perform Autotype in the context menu for an entry or invoking it via keyboard shortcut (default ⌘ + T). MacPass then will activate the last application and send the keystroke sequence defined by the Autotype sequence for the selected entry.

By default, no group nor entry has an Autotype sequence, instead it inherits its sequence from its parent. An entry inherits from its group, a group from its parent group and the root group derives its default sequence from the application. If you need a custom sequence, you can add one to any entry or group. That way you can change the sequence for all entries inside a group or just a single entry.

The Autotype sequence is a string of commands that get evaluated when the sequence is performed.

The default sequence is {USERNAME}{TAB}{PASSWORD}{ENTER}.

This sequence contains Autotype Commands and Placeholders.

Example in Safari

  1. Open a website
  2. Click in the user login
  3. Switch to MacPass and select the corresponding entry
  4. Perform Autotype

Safari will get the focus and for the default Autotype sequence {USERNAME}{TAB}{PASSWORD}{ENTER}, MacPass will type the username in the input field then tab will get sent to switch to the password input, MacPass then will send keystrokes to type the password and then an Enter stroke. With this sequence, most web forms will get submitted correctly.

Global Autotype

To make Autotype even better, there is Global Autotype. It works the same way as Autotype but eliminates the process of having to switch to MacPass and select the right entry. Global autotype is invoked via a shortcut from any application. MacPass then tries to find an entry based on the Window Title of the Application that was front most when the shortcut for autotype was invoked. If MacPass finds a single entry, it will perform an Autotype. If multiple entries are found, MacPass will present a window to choose which entry to use or it will fail with no match.

Matching

The matching can be customised in the Preferences. Since MacPass needs to find an entry to use, it searches for entries matching the following criteria:

  • If a window associations matches, then the entry is selected.
    Either the window title is exactly the same or the window title matches the regular expression of the association.

  • Or if title match is enabled, an entry matches if its title is included in the window title or if the window title is included in the entry's title.

  • Or if URL matching is enabled, a match is found if the window title contains the URL of the entry.

  • Or if host matching is enabled, a match is found if the window title contains the host of the entry URL.

  • Or finally, if tag matching is enabled, an entry matches if any of its tags is contained in the window title.

Improve matching with a browser extension

A website's title can change which makes matching unreliable. The solution is to use a browser extension that add the current host name to the window's title bar.

Example in Safari

Database with three entries

Entry A: Title: MacPass
— URL: www.macpass.com

Entry B: Title: Pass
— URL: www.pass.com

Entry C: Title: Mac
— URL: www.mac.com

MacPass Autotype settings are set to include only title and URL matches.

  1. Open www.pass.com in Safari, the window title is "Pass.com"
  2. Click in the user login input form
  3. Press the global auto type keystroke

Entry A doesn't match

  • Pass.com does not contain MacPass (Title mismatch)
  • MacPass does not contain Pass.com (Title mismatch)
  • www.macpass.com does not contain Pass.com (URL mismatch)

Entry B matches

  • Pass.com does contain Pass (Title match)

Entry C doesn't match

  • Pass.com does not contain Mac (Title mismatch)
  • Mac does not contain Pass.com (Title mismatch)
  • Pass.com does not contain www.mac.com (URL mismatch)

MacPass should now fill the form automatically with the data of Entry B.