A Hazel rule can run a Shortcut if you choose the “Run Shortcut” action and then choose one of your existing Shortcuts from the second pop-up menu. (Shortcuts cannot be used in a rule condition , only in an action.)
Standalone shortcuts that run without any input require no special modifications. However, if you want your Shortcut to act on whatever file or folder Hazel just processed, you must configure it to receive files and folders and then get information from that input. You can use any combination of input sources, or none at all:
-
Choose View > “Show Shortcut Details” and select the Use as Quick Action checkbox to display the Receive action at the top of your shortcut. Click “Images and 18 more” then deselect everything except Files and Folders.
-
Under “If there’s no input,” click Continue, choose Stop and Respond from the pop-up menu, and add a response (such as “No file received”).
-
Add your shortcut actions as usual, being sure to refer to Shortcut Input for information about the file or folder that was processed.
-
Optional: When you’re finished, you can return to View > “Show Shortcut Details” and deselect the Use as Quick Action checkbox (and any others that are also selected), so the Receive action lists “Nowhere” as the source of input.
This simple example Shortcut displays a notification showing the size of the file or folder that was just processed.
SEE ALSO