Jump to content
Acidham

Search Alfred Workflows (Alfred 4)

Recommended Posts

Search Alfred Workflows

Alfred Workflows help to search in Title, Keyword, Description of a workflow and open it in various actions.

 

Requires Alfred 4!

 

Github: https://github.com/Acidham/search-alfred-workflows

 

Options

  • ENTER - Shows a list of keywords in the workflow and starts the workflow with a keyword
  • CMD - For addtional Actions:
    • Copy path to Clipboard
    • Open WF Folder in Terminal (cd )
    • Reveal in Finder
    • Open in ForkLift (requires ForkLift installed)

Config

  • exclude_disabled: True - ignore disabled workflow in search
  • terminal_path: EMPTY opens in macOS shell or path to custom terminal

Screen Shot 2019-05-31 at 16.16.10.png

Share this post


Link to post

It’s not working for me:

 

ERROR: Search Alfred Workflows[Script Filter] Code 1: Traceback (most recent call last):
  File "/Users/MyUsername/Dropbox/Sync/Alfred.alfredpreferences/workflows/user.workflow.88E26D31-D3BB-49EB-B363-DFD40BC8BC70/alf.py", line 102, in <module>
    Workflows = Workflows()
  File "/Users/MyUsername/Dropbox/Sync/Alfred.alfredpreferences/workflows/user.workflow.88E26D31-D3BB-49EB-B363-DFD40BC8BC70/Workflows.py", line 23, in __init__
    self.workflows = self._get_workflows_list()
  File "/Users/MyUsername/Dropbox/Sync/Alfred.alfredpreferences/workflows/user.workflow.88E26D31-D3BB-49EB-B363-DFD40BC8BC70/Workflows.py", line 109, in _get_workflows_list
    i = self.get_item(w)
  File "/Users/MyUsername/Dropbox/Sync/Alfred.alfredpreferences/workflows/user.workflow.88E26D31-D3BB-49EB-B363-DFD40BC8BC70/Workflows.py", line 95, in get_item
    if plist_info['disabled'] and self.exclude_disabled:
KeyError: 'disabled'

 

Share this post


Link to post
36 minutes ago, Acidham said:

Which version of Alfred are you using and which version of the Workflow?

 

I'm getting the same error. The problem appears to be that very old (Alfred 2 vintage) workflows don't necessarily have the disabled key.


I changed the line to if plist_info.get('disabled') and self.exclude_disabled: and everything works great.

 

This workflow is awesome!

Share this post


Link to post

@deanishe yeah I thought the same but I do not have an "vintage" workflow available. I implemented your fix and released on git (0.6.6). Please test. Thx for chiming in!

Share this post


Link to post
Posted (edited)

Nice it works now 😊Thanks for the fix and the workflow, it’s so easy to forget how to trigger all those nice tools!

 

Edit: `Press enter to proceed with Keyword:` does not work for me

Edited by bk161124

Share this post


Link to post
1 hour ago, bk161124 said:

Edit: `Press enter to proceed with Keyword:` does not work for me

 

Got the debugger log? "Doesn't work" isn't really an actionable description of a problem…

Share this post


Link to post
Quote

Edit: `Press enter to proceed with Keyword:` does not work for me

 

From just the description, it is a feature not a bug ;) 

 

In case a Workflow has no Keyword,ScriptFilter or ListFilter you cannot proceed to the next step because there is nothing to choose. 

 

Otherwise please provide more info. 

Share this post


Link to post
On 6/4/2019 at 6:19 AM, Acidham said:

 

From just the description, it is a feature not a bug ;) 

 

In case a Workflow has no Keyword,ScriptFilter or ListFilter you cannot proceed to the next step because there is nothing to choose. 

 

Otherwise please provide more info. 

 

Are you sure it's the current behaviour for keywords? I was pretty sure that in my last PR this was changed to not listing blank keywords. It seems to me @bk161124 is running an outdated version of the workflow.

Share this post


Link to post

I can't get it to work on my system. It is showing this:

[09:59:26.904] ERROR: Search Alfred Workflows[Script Filter] Code 1: Traceback (most recent call last):
  File "/Users/raguay/Dropbox (Personal)/Richard/rag/Alfred/Sync/Alfred.alfredpreferences/workflows/user.workflow.AE1D5FC6-3500-4FA7-8FE2-002FE5D04553/alf.py", line 102, in <module>
    Workflows = Workflows()
  File "/Users/raguay/Dropbox (Personal)/Richard/rag/Alfred/Sync/Alfred.alfredpreferences/workflows/user.workflow.AE1D5FC6-3500-4FA7-8FE2-002FE5D04553/Workflows.py", line 23, in __init__
    self.workflows = self._get_workflows_list()
  File "/Users/raguay/Dropbox (Personal)/Richard/rag/Alfred/Sync/Alfred.alfredpreferences/workflows/user.workflow.AE1D5FC6-3500-4FA7-8FE2-002FE5D04553/Workflows.py", line 109, in _get_workflows_list
    i = self.get_item(w)
  File "/Users/raguay/Dropbox (Personal)/Richard/rag/Alfred/Sync/Alfred.alfredpreferences/workflows/user.workflow.AE1D5FC6-3500-4FA7-8FE2-002FE5D04553/Workflows.py", line 74, in get_item
    plist_info = self._get_plist_info(plist_path)
  File "/Users/raguay/Dropbox (Personal)/Richard/rag/Alfred/Sync/Alfred.alfredpreferences/workflows/user.workflow.AE1D5FC6-3500-4FA7-8FE2-002FE5D04553/Workflows.py", line 45, in _get_plist_info
    return readPlist(plist_path)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 78, in readPlist
    rootObject = p.parse(pathOrFile)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 406, in parse
    parser.ParseFile(fileobj)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 832, column 12

I'm not a python guru, so I'm not completely sure why it's dying. My workflows are in a sync directory in Dropbox. That might be causing some of the problem?

Share this post


Link to post

It’s an XML parse error. It seems that one of your workflows has an invalid info.plist. Or perhaps a non-XML one.

 

The workflow probably needs a try … except to catch workflows it can’t read.

Share this post


Link to post

@raguay.customct Thx for reporting ! Never thought about malformed Workflow info.plist 😕

 

Added try/except block when reading plist ... 0.7.2 ... please try since I do not have malformed workflows installed ;) 

Share this post


Link to post
Posted (edited)

@Acidham That does work. It would be nice to collect the list of malformed workflows and show it to the user or a way to access it. That way I'll know which ones need to be fixed.

Edited by raguay.customct

Share this post


Link to post

I would say that would be an enhancement request for Alfred Preferences  @Andrew

 

I never discovered a WF where info.plist was malformed and I expected that Alfred will throw an error in case  info.plist is corrupt. 

 

So far we don't know what exactly caused the issue. Can you ( @raguay.customct) figure out which workflow caused the issue and share the WF with me for further investigation?

You can figure it out in case the enabled workflow cannot be found by alf.

Share this post


Link to post
6 minutes ago, Reddibit said:

I love your workflow, but I'm also wondering how you setup that awesome theme (appearance) in your topic.

 

Not sure what you mean?

Share this post


Link to post
55 minutes ago, Acidham said:

 

Not sure what you mean?

 

In your main post you show the following theme:

792213066_ScreenShot2019-05-31at16_16_10

Can you share the theme / appearance you are using in Alfred?

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...