This is a collection of smaller workflows, experiments, and demonstrations of interesting concepts for writing automations with the Alfred App.
Some workflows live in their own repository:
- µBib | Citations, BibTeX, and Research
- Quill | Text processing utility
- Ayai · GPT Nexus (alpha)
- DEVONthink 3 Portal
- Logseq Workflow
- Ollama Workflow
- Default Browser
- Unified Search
- Calendar++
Table of Contents
- 1. Workflows
- 1.1. Duden Workflow
- 1.2. What Unicode character is this?
- 1.3. Roman Numeral Converter
- 1.4. DEVONthink ←→ PDF Expert
- 1.5. Define Word - A Better Dictionary
- 1.6. AlfredOCR
- 1.7. Favorites
- 1.8. New File
- 1.9. Keyboard Brightness
- 1.10. GIF from Video
- 1.11. Bluetooth Device Battery
- 1.12. QResolve
- 1.13. GIF from Images
- 1.14 Extract Keywords
- 1.15 Color Picker
- 1.16 PDF to Text
- 1.17 PDF Split
- 1.18 PDF Compress
- 1.19 Scratchpad
- 1.20 Window Navigator
- 1.21 Fuzzy Search
- 1.22 PDF to Table
- 1.23 PDF to Docx
- 2. Proof of Concept & Demos
Search, navigate and view information from duden.de German spelling dictionary. |
shift ⇧
orcmd ⌘+Y
: Get QuickLook previews for the landing page, grammar, and synonymscmd ⌘+L
to view the full entry contents.- Action synonymes to list all synonyms. Action any synonym to view the entry for it.
- Action examples or idioms to list all that are available.
Credits: SwiftSoup
The What Unicode character is this? workflow tells you which unicode character it is. Given a character or string, you will get the unicode code points, the scalar names and general categories. |
- KATAKANA LETTER TU
U+30C4
- Other Letter
⌘ cmd
yields\u{30C4}
(swift, ES6 formatted)⌥ opt
yields\u30C4
(python, go formatted)⌃ ctrl
yieldsツ
(HTML entity)⇧ shift
yields0x30C4
(hex literal)
Given a hex value either raw or in any of the above formattings will return its corresponding unicode character.
whatisit? \u{1F914}
yields info for 🤔
Convert Roman numerals to decimal and vice versa. Accepts Arabic numbers in the range 1 to 3999. |
The PDF, of course, has to live in one of your open DEVONthink databases.
cmd ⌘
to open the PDF on the same page in DEVONthink.xdev
to enable or disable opening the document in DEVONthink when using the hotkey
Expected result A
x-devonthink-item://1D7FA99A-AAFF-4883-9853-F0666A650400?page=6
Expected result B
x-devonthink-item://1D7FA99A-AAFF-4883-9853-F0666A650400?page=6&start=66&length=9&search=selection
Expected result C
x-devonthink-item://1D7FA99A-AAFF-4883-9853-F0666A650400?page=6&annotation=Squiggly&x=212&y=406
- Fails with documents opened in PDF Expert split view
xdev2.0.0.mp4
Customizable Dictionary with Quicklook Preview - and Dark Mode. |
shift
or cmd+Y
to preview the dictionary entry
ctrl
to see the dictionary associated with the entry
cmd + ⏎
to paste a word to the frontmost application (spell checker)
cmd+C
to copy the dictionary entry's plain text to the clipboard
cmd+L
to view the plain text as Large Type
You can define dictionaries for lookups, set the font size of the previews, or manually select a dictionary to use. The previews reflect the global appearance, i.e. they have a dark mode. The workflow also includes a preset for looking up synonyms of a word and a convenient keyboard shortcut for quick lookups. To use the workflow as a multilingual spell checker, you can use the cmd
modifier when actioning the entry to paste the word to the frontmost application.
No external dependencies are required to perform the OCR.
The workflow allows you to copy text from images using optical character recognition. Take a snapshot with your mouse or trackpad and the recognized text is automatically copied to the clipboard. You can also extract text from images sent to the workflow's File Action. |
The workflow allows you to copy text from images, or to convert PDF files into searchable PDF documents using optical character recognition, and to apply compression to PDF documents. |
1 / Snapshot
Take a snapshot with your mouse or trackpad and the recognized text is automatically copied to the clipboard.
- Default shortcut: ⌘ ⇧ 6
- Default keyword:
ocr
2 / PDF Document
-
To convert a PDF into a searchable PDF document, pass it to the workflow's Universal Action.
- To compress the resulting PDF, pass the source document on while pressing the ⌘+⇧ keys.
- To open the resulting PDF, pass the source document on while pressing the ⌥+⇧ keys.
- To force the replacement of a source document, pass it on while pressing the ⌥+⌘ keys.
-
To compress a PDF without performing OCR, pass it to the
Compress PDF Document
File Action. -
To view the progress tracker, re-enable the workflow with the
Keyword
(default:ocr
).
Add files and folders to your list of favorites by using the workflow's Universal Action. Quickly find them again by activating the workflow with the |
- Hit
enter
orcmd+O
to open a file or folder. - Add items with the workflow’s Universal Action.
- Modifiers:
ctrl
: Show full Pathcmd
: Reveal in Finderopt
: Browse in Alfredcmd+shift
: Move upopt+shift
: Move downfn
: Remove from Favoritesshift
orcmd+Y
: Quicklook Preview
The workflow will pick up on your location in the Finder and create the new file there. If you use the keyword, the most recently used Finder window will be selected as the destination. If no Finder window is currently open, the file will be created in the configurable fallback location.
Bonus: In addition to all plain-text type files, the workflow can also quickly create docx
, doc
, odt
, rtf
and rtfd
documents and Xcode playground
s.
Creating a new file
- ⌘ to view the full path to the target folder.
- ↩ to create the file with configured settings.
- ⌘⇧↩ to create the file with clipboard contents.
- ⌥⇧↩ to create the file without clipboard contents.
If auto-suggest is enabled, press TAB to accept and expand the suggested filename. (new in v1.2.0)
The workflow allows you to convert video of popular formats to animated GIFs. To do this, it uses ffmpeg as a dependency. |
Either send a video to the workflow's File Action or invoke the workflow using the keyword and search for the video file you want to convert. Then select the image size you want the resulting GIF to have from the list to start the conversion.
View the battery charge status of connected Bluetooth devices (macOS 13.0+). Install Apple's SF Pro font to see the icons. |
Resolve and open links from QR codes |
A / Take a snapshot of the QR code you want to open the link to
- Default keyword:
qrr
- Recommended shortcut: ⌘+⇧+7
B / Send an image containing the QR code to the workflow's File Action
The workflow allows you to convert a series of still images into animated GIFs. For this, it uses ImageMagick as a dependency. |
Send a series of still images to the workflow's File Action to create an animated GIF. The smallest image determines the dimensions of the result. All source images are assumed to be of the same file type, e.g. jpg or png.
Extract keywords and keyphrases from articles, books or other documents with YAKE! |
- Send
PDF
,docx
,doc
,rtf
ortxt
documents to the workflow's File Actions - Pass the text from your selection in macOS on to the workflow's Universal Action
- Use the keyword and paste your text (default:
kw
)
The workflow relies on Python3 to install the YAKE standalone.
pip install git+https://github.com/LIAAD/yake
- official installation guide
brew install poppler
- formula on brew.sh
Pick a color to get its hex, rgba, hsl representation or NSColor initializer. |
Activate the Color Sampler with the keyword (default: cp
) and pick the desired color.
To review previously picked colors, activate the workflow with the keyword preceded by a colon (default: :cp
).
Extract text from PDF documents. |
Extract the entire text from one or more PDFs by sending them to the workflow's File Action or locate a PDF with the File Filter by using the keyword (default: pdftotext
). To extract the text from specific pages of a single document, use the ⌘ modifier. The result will be exported as a plain text document.
- ↩ Proceed to extract the entire text.
- ⌘↩ Proceed by specifing the pages to extract.
- ⌃↩ Proceed, push the result to the File Buffer and action it in Alfred.
- ↩ Proceed to extract the entire text.
- ⌘↩ Proceed by specifing the pages to extract (single file only).
- ⌃↩ Proceed, push the result(s) to the File Buffer and action them in Alfred.
- ↩ Proceed to extract text from the specified pages.
- ⌘↩ Preview the first and last PDF pages w/ Alfred's PDF View.
- ⌥↩ Preview the contents of the first and last page w/ Alfred's Text View.
- ⌃↩ Proceed, push the result to the File Buffer and action it in Alfred.
Press ↩ to return to the view where you can set the start and end pages.
- With Homebrew install
- Poppler:
brew install poppler
Easily extract a specific page range from an existing PDF document and create a new PDF file with the selected pages. |
Either invoke the workflow by using the keyword (default: pdfsplit
) and locate a PDF, or send a PDF to the workflow's File Action. Specify the start and end pages of the range you want to be extracted. The specified first and last page can be previewed by pressing the ⌘ modifier.
- ↩ Proceed to extract text from the specified pages.
- ⌘↩ Preview the first and last PDF pages w/ Alfred's PDF View.
- ⌥↩ Proceed, push the result to the File Buffer and action it in Alfred.
Press ↩ to return to the view where you can set the start and end pages.
- With Homebrew install
- Poppler:
brew install poppler
Compress PDF documents. |
Either invoke the workflow by using the keyword (default: pdfcompress
) and locate a PDF, or send a PDF to the workflow's "Compress PDF Document" File Action.
A compression preset can be selected by pressing ⌥ before proceeding with ↩.
- ↩ Proceed to compress the PDF using the default strategy.
- ⌥↩ Select a compression preset.
- ↩ Proceed to compress the PDF using the default strategy.
- ⌥↩ Select a compression preset.
- ↩ Proceed to compress the PDF using the selected strategy.
The result will be a compressed document in the same location as the source PDF file.
- With Homebrew install
- Ghostscript:
brew install gs
Quickly access up to 9 scratchpads for spontaneous note-taking. |
Press the keyboard shortcut to open the scratchpad that was last used.
Press the keyboard shortcut again or ⎋ to dismiss the scratchpad without saving.
In Editing Mode
- ⌘⏎ to save changes¹
- ⇧⏎ to preview as rendered markdown
- ⌥⏎ to view all pads and search your notes²
- ⌘⇧⏎ to cycle through your scratchpads
In Markdown Mode
- ⏎ or ⇧⏎ to start editing
- ⌥⏎ to view all pads and search your notes²
- ⌘⇧⏎ to cycle through your scratchpads
- ⎋ to either cancel or go back through previously viewed pads
Press the secondary keyboard shortcut or enter the workflow's keyword (default: pad
) to view all scratchpads and to search their contents.
Notes:
¹ Changes are also saved when previewing and when switching the active pad.
² When searching for a pad containing a keyword, the first matching line will be used as subtitle. Press ⌘L to view the matched line as Large Type.
Navigate to any window of the currently focused application or any application across all desktops, or switch windows within the current desktop space. |
Note
macOS 15 deprecates an API that Window Navigator uses to retrieve window information. Already compiled executables will continue to work as expected, but compilation will fail if you try to run the workflow for the first time with macOS 15. I'm investigating a solution to this problem.
- Search the windows of the active app globally using the Navigator keyword.
- Search app windows in the current desktop space using the Switcher keyword.
- Search all visible windows of all apps globally using the Global keyword.
- ↩ to navigate to the selected window.
- ⌘↩ to close the selected window.
- ⌥↩ to quit the owning application.
Limited scope fuzzy search.
|
Extract tables from PDF documents as CSV. |
Extract tables from PDFs via the Universal Action and export them as CSV.
- Use PDF to Table (Lattice) if there are ruling lines separating each cell
- Use PDF to Table (Stream) if there are no ruling lines separating each cell
Convert PDFs to Word documents. |
- Install pdf2docx via the command line:
pip install pdf2docx
Convert PDFs to Word documents (docx) via the Universal Action.
Modifier Palettes & Double Tap Hotkeys. Proof of concept and demo implementation of modifier palettes to invoke actions on consecutive keystrokes in Alfred.
Modifier Palette example behavior.
⌥O
,⌥K
To trigger action A.⌥I
,⌥K
To trigger action B.
Double-Tap Hotkey example behavior
⌃+
,⌃+
To trigger action.
The core idea is to inject environment variables into the workflow configuration and to modify them with some delay.
-
To set up modifier palettes, all you have to do is define an identifier on any hotkey,
⌥O
, such as "openA
". This is the "text" argument that the hotkey passes on as{query}
. Set the identifier to some environment variable, say "gate
", and use a downstreamconditional object
triggered by a different hotkey,⌥K
, to check if the variable ({var:gate}
) is equal to the identifieropenA
. Any action that you make depend on this condition will be triggered iffgate
is equal toopenA
, i.e. if you have recently tapped the hotkey associated with the identifier. -
To set up double-tap hotkeys, proceed in the same way, defining an identifier for the hotkey's "text" argument. For each double tap hotkey, an environment variable is injected that is either
0
or1
for inactive or active.
Disclaimer
: Alfred may crash if you get the timing of the keystrokes just right. This is due to a data race where the same variable ("gate
") is accessed and modified by different threads at the same time. Also, for the double-tap hotkeys, there is some "bleed" into the other hotkeys with the way it is set up in the demo. Tapping a, then b, will also trigger b, instead of having to tap b twice.
An example of how to handle permissions gracefully for your executables. (For now, take a look at the Duden Workflow that implements the permission handler).
Run a graphical prompt and read the input. Proof of concept for using NSWindow and SwiftUI components to get user input through a graphical prompt and then use it in the Alfred app - or on the command line.
Demo for displaying notifications on a heads-up display.
The script takes two arguments:
- The text to display
- The width of the prompt