dfay Posted May 14, 2014 Posted May 14, 2014 (edited) Workflow Picker Newly updated to work with Alfred 3 Select from Installed Workflows I have more workflows and associated keywords and script filters than I can remember. Rather than going into Alfred’s Preferences, I wanted a quick way to see the keywords & script filters available in the workflows I have installed, (optionally) grouped by the categories that have been available since Alfred 2.2. Inspired by Shawn Rice’s Workflow Help workflow and deanishe’s Appscript workflow, I put this together. There are five keywords: wfa - List all installed keywords/script filters wfp - Select a category to list keywords/script filters wfc - List keywords/script filters within a category alphabetically wfg - List keywords/script filters within a category, grouped by workflow hot - List all hotkeys (this does not execute the hotkey - it’s just a way of seeing them all, and potential hotkeys which have no key assigned) By default, wfp outputs to an Applescript which calls wfc on the selected category. This can easily be changed in the workflow layout in Alfred Preferences to call wfg instead. Alfred 3 compatible version hosted at https://www.dropbox.com/s/14sxodqbyoqa74n/Workflow Picker 3.alfredworkflow?dl=0 Details to manually update for Alfred 4 are further along in this thread.... Version History: 2014–05–13: initial release 2014–05–15: 1.01 updated to make sure prefs.plist file with categories exists 2014–05–15: 1.02 added wfa, updated prompts 2014-05-20: 1.03 added hot 2014-05-22: 1.04 updated to make afp and hot filter by query 2016-05-20: 3.0 updated for Alfred 3 Edited August 9, 2021 by dfay update url katie and mixterdee 2
smarg19 Posted May 15, 2014 Posted May 15, 2014 This is a great idea for a workflow, but I'm hitting an issue. I don't have a prefs.plist file in my workflows directory. So, when I try to run wfp, I get this error log: Starting debug for 'Workflow Picker' [ERROR: alfred.workflow.input.scriptfilter] Code 1: 22:27:27 workflow.py:1256 ERROR [Errno 2] No such file or directory: '/Users/smargheim/Dropbox/Alfred.alfredpreferences/preferences/workflows/prefs.plist' Traceback (most recent call last): File "/Users/smargheim/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.EB3BA534-54EA-4950-8F05-7815C0A63EDA/workflow/workflow.py", line 1254, in run func(self) File "categories.py", line 38, in main pl = readPlist(workflowPath) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 75, in readPlist pathOrFile = open(pathOrFile) IOError: [Errno 2] No such file or directory: '/Users/smargheim/Dropbox/Alfred.alfredpreferences/preferences/workflows/prefs.plist' Where else might this file be? I back up Alfred to Dropbox, so (as you can see) my .alfredpreferences directory is there. Does that change something?
dfay Posted May 15, 2014 Author Posted May 15, 2014 This is odd, b/c it means the script has successfully read your prefs in ~/Library/Preferences/com.runningwithcrayons.Alfred-Preferences.plist (which aren't synced) and found the syncfolder key therein. And the path that is created looks correct. Looking in the ....Alfred.alfredpreferences/preferences/workflows/prefs.plist file, the only thing that is in there is the list of categories. Two questions for you: - are you running Alfred 2.2 or later? This is the version that introduced categories, and the file may not exist in prior versions. - have you placed any workflows into categories? It may be the case that Alfred only creates the file if new categories are created, not by default.
dfay Posted May 15, 2014 Author Posted May 15, 2014 Try the new version I just posted as well -- it should avoid the error message in any case.
vdesabou Posted May 15, 2014 Posted May 15, 2014 Try the new version I just posted as well -- it should avoid the error message in any case. Hi, When I try your workflow, I get:- Starting debug for 'Workflow Picker' [ERROR: alfred.workflow.input.scriptfilter] Code 1: 00:02:43 workflow.py:1256 ERROR 'categories' Traceback (most recent call last): File "/Users/vdesabou/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.00D8AA6A-5472-4597-8407-BF65330664C1/workflow/workflow.py", line 1254, in run func(self) File "categories.py", line 53, in main for i in pl['categories']: KeyError: 'categories' Any idea what's wrong? Thanks!
dfay Posted May 15, 2014 Author Posted May 15, 2014 (edited) Yeah, it's reading your .plist correctly but it seems there's no 'categories' key in your plist. This probably means you haven't created any. I just posted an updated version which should handle this situation and just default to All. Edited May 15, 2014 by dfay vdesabou 1
dfay Posted May 21, 2014 Author Posted May 21, 2014 Updated with keyword to list all installed hotkeys.
raguay.customct Posted May 21, 2014 Posted May 21, 2014 It would be good to type in the key and search for those items that match. If I type anything, it just bombs to default search. Also, The hotkeys is great, but I think it would be best just to not list the ones not assigned yet. Thanks! Great workflow.
dfay Posted May 22, 2014 Author Posted May 22, 2014 Updated to filter based on query. I am leaving assigned and unassigned in the output -- this can be easily changed by editing list_hotkeys.py in the workflow directory & changing the line: results = start+end to # defined hotkeys only results = start or # undefined hotkeys only results = end
politicus Posted August 23, 2014 Posted August 23, 2014 (edited) @dfay This is an awesome workflow! Some feedback: - I have some problems with arrow based keyboard shortcuts. (Error reading Hotkey : Try re-enter ...). -Iin the results, I think it would be better to display modifier keys (cmd,option,ctrl,shift,fn) first, then letters, numbers. Better readability (to me). Feature request : (When using wfp, wfc, wfg) Would be awesome to be able to filter results by starting typing the workflow's keyword. For example, "wfc Category Name g". (When using hot) Would be awesome to filter workflows by keyboard shortcut. What do you think? Edited August 23, 2014 by politicus
racoonlab Posted October 24, 2014 Posted October 24, 2014 Strange if I use wfp I see only the option All, but when I double click on a workflow in alfred preferences, I see the category of the workflow belongs to, for example I see MyIp workflow belongs to internet. Grep for "prefs.plist" I see no results, but files where prefs.plist is mentioned. Any hint?
dfay Posted October 24, 2014 Author Posted October 24, 2014 Hmm....that is a file that seems to exist in some people's Alfred installations and not others. The workflow checks for its existence, and if it doesn't exist, it defaults to All. Could you try adding a category in Alfred prefs., and/or changing a category? I'm not sure what it takes for Alf to generate this file.
mixterdee Posted October 27, 2014 Posted October 27, 2014 Can't believe I have not used this workflow before. Thanks it is extremely helpful. dfay 1
dfay Posted May 20, 2016 Author Posted May 20, 2016 Just updated this with a new version for Alfred 3. mixterdee and nm1 2
HaubenTaucher Posted May 23, 2016 Posted May 23, 2016 Great Workflow. Thanks for your work.... Very helpful...! Best Rolf
dfay Posted November 30, 2017 Author Posted November 30, 2017 Should be fixed now - casualty of dropbox share policy changes
paulw Posted August 9, 2021 Posted August 9, 2021 (edited) Hi @dfay, I'm getting errors running this workflow in Alfred 4 that have to do with Alfred 3 file paths. Fixed by opening categories.py and replacing references to ~/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist with ~/Library/Preferences/com.runningwithcrayons.Alfred-Preferences.plist and replacing references to ~/Library/Application Support/Alfred 3/Alfred.alfredpreferences/preferences/workflows/ with ~/Library/Application Support/Alfred/Alfred.alfredpreferences/preferences/workflows/ And lastly, editing the osascripts in the workflow to replace "tell application "Alfred 3" with "tell application "Alfred". And thanks for the workflow! Edited August 9, 2021 by paulw more edits to workflow needed
dfay Posted August 9, 2021 Author Posted August 9, 2021 I've actually had this disabled for the last few years. Glad to see it was such an easy fix. paulw 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now