Download the latest version of the workflow from here.
Alternatively you can build the workflow yourself following the instructions below.
- Trigger Alfred
- Type
snpt
and press enter or tab - Start typing the name of the snippet you want to copy
- Use the up / down key to navigate to the snippet you want to copy
- Press enter on the snippet that you want to copy
A notification will be displayed once the snippet has been copied to the clipboard.
- Ensure you have
Go 1.20
installed - Clone this repo and navigate into the directory
- Run
make install
to install the project dependencies - Run
make build
to build the workflow
The workflow should be built (snpt.alfredworkflow
) and placed in the build
directory.
You will most likely see this error if you have downloaded the workflow from GitHub. This error is because there is a binary that is packaged with the workflow that was compiled on the build server and has not been notarized.
Don't worry, this binary is not doing anything nefarious, you can verify the source yourself in the bin
directory.
To get the workflow working:
- Press the
cancel
button on the dialog - Go to
System Preferences -> Security & Privacy
and allowalfred-snpt
to run
- Try and run the workflow again and if you see the following error, press the
open
button on the dialog
From now on you should be able to run the workflow without any problems 🎉
Do not do any of the above if you have not downloaded the workflow from GitHub - Follow the instructions on how to build workflow yourself.
The workflow will search for snpt
in:
/usr/local/bin/
/usr/bin
/bin
/usr/sbin
/sbin
If you have installed snpt
to a different location you will need to modify the workflow to use this path:
- Go to Alfred preferences
- Select the
snpt
workflow - Double click on the
Script Filter
node - In the script field, you should see
export PATH=/usr/local/bin/:$PATH
at the top of the field. Modify this to include your path forsnpt
:
export PATH=/usr/local/bin/:/my/custom/path/bin/:$PATH
Repeat the above for each Run Script
node in the Alfred workflow.