Your Own Actions
An action takes the selected text, does something with it, and gives you a result. Add your own to the action menu.
Make an action
Open Actions in the sidebar, click New Action, and pick a kind. Test it on sample text under Try It.
| Kind | Gets the selection as | Example |
|---|---|---|
| Open URL | {text}, URL-encoded. Pipes work: {text | lower} | https://github.com/search?q={text} |
| Shell Script | Standard input and $EXPANDER_TEXT (zsh). Output is the result. | tr a-z A-Z |
| AppleScript | The variable selectedText. The script’s result is the result. | return "Hi " & selectedText |
| JavaScript | The variable text. The last expression is the result. | text.split("").reverse().join("") |
| Shortcut | The shortcut’s input. Its output is the result. | A shortcut name |
- Result: Replace the selection, insert after it, copy it, show it, or do nothing.
- Show When: Any text, a link, an email address, a file path, or a regular expression. Also a length range and the apps it runs in (bundle identifiers, separated by commas).
New actions start hidden. Right-click one and choose Show in Action Menu; a star marks the ones in the menu.
Ready-made actions
Typefu comes with 56 actions. Show the ones you want in the menu, edit any of them, and choose Restore Original to undo your edits.
Search
| Action | What it does |
|---|---|
| Google, Bing, DuckDuckGo, Kagi | Searches the web. |
| YouTube, Reddit, Amazon, IMDb | Searches that site. |
| Wikipedia | Looks it up on English Wikipedia. |
| Wolfram Alpha | Asks Wolfram Alpha. |
Reference
| Action | What it does |
|---|---|
| Merriam-Webster | Looks up a word. |
| Urban Dictionary | Looks up slang. |
| Google Translate | Translates to English. |
| Wayback Machine | Shows archived copies of a link. |
| Open DOI | Opens the paper for a DOI like 10.1000/182. |
Maps
| Action | What it does |
|---|---|
| Apple Maps, Google Maps, OpenStreetMap | Finds the place on the map. |
Apps
| Action | What it does |
|---|---|
| New Mail Message | Starts an email with the selection as the body. |
| New Bear Note | Creates a note in Bear. |
| New Draft | Creates a draft in Drafts. |
| Add to Things | Adds a to-do in Things. |
| Run in Terminal | Runs the selection as a command in a new Terminal window. |
Markdown
| Action | What it does |
|---|---|
| Markdown Link | Turns a link into [](link). |
| Bullet List, Numbered List, Checklist | Turns lines into a list. |
| Blockquote | Quotes each line with > . |
| Inline Code | Wraps in backticks. |
| Code Block | Wraps in a fenced code block. |
Text
| Action | What it does |
|---|---|
| Join Lines | Joins lines with spaces. |
| Comma List | Turns lines into a, b, c, or back into lines. |
| Reverse Lines, Shuffle Lines | Reverses or shuffles the line order. |
| Remove Empty Lines | Removes blank lines. |
| Slugify | Hello World! → hello-world |
| Wrap in Quotes, Wrap in Parentheses | Wraps in “curly quotes” or (parentheses). |
| Straighten Quotes | Replaces curly quotes with straight ones. |
| Alternating Case | wRiTeS lIkE tHiS. |
| ROT13 | Shifts letters by 13. Run it again to undo. |
| Sum Numbers | Adds up every number in the selection. |
Developer
| Action | What it does |
|---|---|
| Search GitHub, Stack Overflow, MDN, Apple Developer | Searches that site. |
| Open GitHub Repo | Opens owner/repo on GitHub. |
| Escape HTML, Unescape HTML | Converts <, >, & and quotes to and from entities. |
| Validate JSON | Shows whether the selection is valid JSON. |
| Toggle // Comment, Toggle # Comment | Comments or uncomments lines. |
| Unicode Code Points | Shows U+0041 for each character. |
| Unix Timestamp to Date | Shows a timestamp as an ISO 8601 date. |
| Extract Email Addresses, Extract Links | Copies each one, one per line. |
More are shared in the GitHub repo .
Share actions
Right-click an action and choose Export…. Use Import Actions… to add .json or .js files. A .js action keeps its settings in comments at the top:
// @name Reverse Text
// @icon arrow.left.arrow.right
// @output replace
// @regex .+
// @apps com.apple.TextEdit, com.apple.Notes
return text.split("").reverse().join("")@icon is an SF Symbol name. @output is replace, insertAfter, copy, show or none. @regex and @apps are optional.
Last updated on