Hit your hotkey and Cheaters will appear in a web-popup.
Cheaters is a customizable cheat sheet system for OS X written by Brett Terpstra.
The script has simple logic:
- checks if
gitis installed, if not, exit.
- checks if Cheaters is already installed:
- if not, clone repo from GitHub into the workflow directory, then run workflow.
- if true, then check if it’s a
- if not, exit.
- if true, check if there are any uncommitted/untracked/unstashed files:
- if not, update the repo (not sure this is needed, updating from remote origin/upstream was my plan), then run the workflow.
- if true, ask user if they want to overwrite/reset, then run the workflow.
One slight complication/hack is that there are two Automator workflows.
The first runs an AppleScript that starts the second Automator workflow, waits for a couple of seconds then kills the “Automator Launcher” process that started the second Automator workflow. If the launcher process is not killed, the Automator progress spinning gear appears in the Menu Bar and keeps spinning until you close the web-popup.
- Find more elegant solution to the Automator Launcher spinning gear icon hack. I tried this as both an Automator workflow and an application, both spawn the spinning gear. If everyone had Bartender, the spinning gear could be hidden by Bartender and there would be no need for the two workflows. Suggestions welcome!
- Update Cheaters git repo from origin/upstream master.
- Show progress indicator when cloning/updating.
Implement update logic. I should have put the git repo in
~/Library/Application Support/Alfred 2/Workflow Data/$bundle_id. As it is now, the Cheaters git repo is wiped out when you install a new version of the workflow.
Make Alleyoop compatible.
Update – 16th April 2013
Updated to v1.3 to fix various issues with spaces in paths. The download link above points to the new version, GitHub is updated and Alleyoop should pick up the update too.