Boost Mac Productivity: Automate Shadowsocks & Image Uploads with Alfred Workflows
Learn how to dramatically improve Mac development efficiency by creating Alfred workflows that automate repetitive tasks, including toggling Shadowsocks connections via AppleScript and instantly uploading screenshots to Qiniu using Python scripts, with step-by-step examples and configuration guidance.
Previously I wrote an article about improving Mac development efficiency, but it didn’t cover the powerful tool Alfred.
In this article I show how to use Alfred to build custom workflows that replace boring repetitive tasks with automation scripts, providing two example plugins.
Workflow Overview
Alfred’s workflow feature can turn common tasks into a single streamlined process.
AppleScript Plugin: Toggle Shadowsocks
Many users switch Shadowsocks or GoAgentX connections manually, which is tedious. By using AppleScript we can script the open/close actions.
Open Script Editor, choose File → Open Dictionary, find the target application to see available commands.
Example script (shown in the image below) demonstrates how to trigger the connection button.
Python Plugin: Upload Screenshots to Qiniu
For tasks involving network requests, file I/O, or shell commands, Python is more suitable.
Uploading screenshots to a cloud image service traditionally requires several manual steps. The workflow reduces this to three actions:
Press Command+Ctrl+A to capture a screenshot directly to the clipboard.
Type gn in Alfred to trigger the upload.
The image is uploaded, its URL copied to the clipboard, and you can paste it immediately.
Configuration steps:
Run qnconf in Alfred and provide your Qiniu AK and SK keys.
Edit conf.txt in the workflow folder to set the target bucket and URL prefix.
When the clipboard contains an image, type qn (optionally followed by a name) to upload; the URL is copied automatically.
Conclusion
The goal of this article is not to teach workflow development or Python syntax, but to illustrate how learning a scripting language and leveraging a powerful application can greatly boost personal efficiency.
References
AppleScript Ultimate Guide
Alfred Workflow Development Guide
pngpaste
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
