Small workflow shortcuts matter because they remove the tiny interruptions that break concentration.
String encoding is a good example. It is not a big task, but it appears often enough that it benefits from a fast path.
This workflow handles two common jobs:
- URL encoding
- Base64 encoding
One of the reasons the workflow is helpful is that the source text can come from a few places:
- clipboard contents for quick ad hoc encoding
- a direct argument when you already know the exact input
- selected text through Alfred Universal Actions
That flexibility means the shortcut works inside the flow you are already in, rather than forcing a copy-paste ritual every time.
URL encoding
#!/bin/zsh
TEXT="$1"
if [ -z "$TEXT" ]; then
TEXT=$(pbpaste)
fi
/usr/bin/osascript -l JavaScript -e "encodeURIComponent('$TEXT')"
Base64 encoding
#!/bin/zsh
TEXT="$1"
if [ -z "$TEXT" ]; then
TEXT=$(pbpaste)
fi
echo -n "$TEXT" | base64
Why this kind of shortcut matters
The point is not that encoding is hard. The point is that small workflow annoyances add up when they appear repeatedly through the week.
This sort of automation sits in the same general category as other useful utility shortcuts, like UUID and key generation with Alfred: tiny pieces of friction removed close to the point where they actually occur.