Save snippets
Save text you type often, such as an address or a standard reply, as a snippet. To add one, choose File > New Snippet…, or click Snippets in the Library window.
To copy a snippet, type its name or a keyword in Quick Open, then press Return.
Work with other apps
Library works with other apps in three ways:
- the
library://address, which other apps and web pages can open; - Add to Library in the Services menu;
- Spotlight, which finds your items in any search.
URL scheme
Library handles links that start with library://. A link never opens the Edit Library window. It does one of the following three things.
| Link | What it does |
|---|---|
library://open?name=NAME | Opens the bookmark or application named NAME |
library://open?name=NAME&value=VALUE | Opens the bookmark or application named NAME, and fills its template with VALUE |
library://menu | Shows the Library menu |
library://search | Opens Quick Open |
Examples:
library://open?name=Jiralibrary://open?name=Jira&value=ABC-123library://open?name=Team%20Boardlibrary://menulibrary://search
How the name is matched
- The name must match an item's name exactly, ignoring case. Library does not match part of a name.
- Library looks at bookmarks, applications, and dividers, in the order they appear in the library. It uses the first item that matches.
- Folders are never matched.
- Terminal commands are never matched, so a link can never run one.
- Items in Recently Deleted are not matched.
- A divider with the same name as a bookmark can be matched first, and then nothing opens. Give dividers names that differ from your bookmarks.
- If nothing matches, the link does nothing and shows no message.
How the value is used
- If the bookmark has exactly one field in its address,
valuefills it, and Library does not ask for a value. - If the bookmark has more than one field, Library asks for all of them in one sheet, and
valueis ignored. - If the bookmark is a template and no
valueis given, Library asks for the value. - Spaces in a value must be encoded as
%20. - A value is used as typed. Nothing asks you to confirm it.
What the scheme does not do
- It does not open commands, so a web page cannot run a terminal command with it.
- It does not show a window, and it does not change your library.
- Unknown hosts, such as
library://something, and any other parameters are ignored.
Anything that can open a library:// link can open any bookmark or application in your library by its name, with no confirmation. A link can also fill a template's single field with a value, with no prompt. Give your items names you are comfortable with other apps and web pages using.
Services
Library adds two items to the Services menu: Add to Library. They appear in the Services menu of most apps, and in the Finder's right-click Services menu.
Add a link from any app
- Select a web address in an app, such as a page address in a document or a message.
- Choose Services > Add to Library.
- The selection must be one web address that starts with
http://orhttps://. A bare domain, such asexample.com, is not accepted here, though Quick Open accepts it. - The selection can be up to 4,096 characters. Spaces and line breaks around it are ignored.
- The new bookmark goes at the top level of the library. It is named after the address's host, and its address is the text you selected.
- If the selection is not a web address, Library shows the message "The selection is not a web link."
- Library does not check for duplicates, so adding the same address twice gives two bookmarks.
- If Name new bookmarks from their pages is on in Settings, Library then reads the page's title and uses it as the name.
Add applications and folders from the Finder
- Select one or more applications or folders in the Finder.
- Choose Services > Add to Library.
- Each application is added by its name and path. Each folder is added as a link to the folder. Choosing a folder opens it in the Finder.
- Applications and folders already in the library are skipped.
- Other files in the selection are ignored. If nothing in the selection can be added, Library shows the message "Only applications and folders that aren't already in your library can be added."
- The additions go at the top level and are one undo step named Add to Library.
If the Services items do not appear
Log out and back in, or run /System/Library/CoreServices/pbs -update in Terminal. Library asks macOS to refresh its services each time it starts.
Spotlight
Library adds its items to the Spotlight index, so Spotlight can find them.
What is indexed
- Every bookmark, application, terminal command, and template that opens something.
- Not folders, dividers, or items in Recently Deleted.
What Spotlight sees for each item
- Title: the item's name.
- Description: the address, command, or application path, with the item's note on the line below it.
- Keywords: the item's keywords and its color name, such as "red."
When the index updates
- Library waits about 0.8 seconds after you change the library, then updates Spotlight.
- It only changes Spotlight when something Spotlight shows has changed. Renaming an item, editing its keywords, note, or address, or deleting it all count.
- Library keeps its entries in one search domain called "library." It also removes an older domain called "bookmarks" when it updates.
Opening a result
Opening a Spotlight result runs the item the same way the Library menu does:
- a bookmark opens in its browser;
- an application opens or comes to the front;
- a template asks for its value first;
- a terminal command runs in Terminal right away, unless Confirm Terminal Commands is on.
There is no setting that turns Spotlight indexing off. Delete an item to take it out of the index. Removing its note or keywords changes only what Spotlight shows for it.
The index is stored by macOS on this Mac. Library does not send it anywhere.
Limits and defaults
- The URL scheme handles only the three hosts above. Any other
library://link is ignored. - Services accepts one web address of up to 4,096 characters, or applications and folders.
- Spotlight indexes all openable items, and updates about 0.8 seconds after a change.
- Shortcuts results are limited as listed above: five items for Frequently Used, 20 for Search Clipboard History.
- Only Run Terminal Command asks you to confirm an action. Open Library Item asks for a template value only when none was given.