Jump to content

Filter after Hotkey breaks the workflow when Hotkey is used in Finder [Fixed 3.6.2 b921]


Tsunami

Recommended Posts

v3.6.2 [918] - macOS 10.13.5

 

See https://puu.sh/AKt52/4819d0a6d0.alfredworkflow. When the top Hotkey is used while a folder is selected in Finder, only the folder name is copied to the clipboard. The workflow doesn't seem to expand the full path and continue past the Filter. However, as you can see with the bottom Hotkey, it does work when you add an Args and Vars before the Filter.

Link to comment
Share on other sites

  • 2 weeks later...

Here is the output:

[2018-07-02 11:58:58][utility.debug] '/Users/Tsunami/dev/alfred-workflows', {}
[2018-07-02 11:59:01][utility.debug] '/Users/Tsunami/dev/alfred-workflows', {}

So both hotkeys do pass through the full path in {query}. I also tried putting the Debug utility after each Filter, but again the first hotkey did not go past the Filter, so there was no debug output for the first hotkey.

Link to comment
Share on other sites

@Tsunami Ah interesting, I see what you're saying now. I've taken a look at the code and it looks like the filter only operates when there is a string fed into it, but the hotkey selection passes a list of one or more files out of it.

 

I'll get this sorted for the next release :)

 

Cheers,

Andrew

Link to comment
Share on other sites

  • Andrew changed the title to Filter after Hotkey breaks the workflow when Hotkey is used in Finder [Accepted]

In case it wasn't obvious, I don't want my workflow to continue if nothing is selected. So maybe you could just terminate the workflow if the hotkey argument is set to "Selection in macOS", but nothing is actually selected when the hotkey is triggered. At that point you hear a beep indicating the OS failed to copy anything, but Alfred still passes an empty string to the rest of the workflow. This happens in any app and seems undesirable to me.

Edited by Tsunami
Link to comment
Share on other sites

  • Andrew changed the title to Filter after Hotkey breaks the workflow when Hotkey is used in Finder [Fixed 3.6.2 b921]

@Tsunami this should now be fixed in the 3.6.2 b921 pre-release. As before, the hotkey will pass through an empty selection if no selection is made in Finder, but the filter will now work in both cases for your workflow.

 

While your suggestion of not continuing if no selection is made is potentially a good one, this can now be correctly addressed with the filter and gives ultimately more flexibility. Changing this behaviour would almost certainly create regression issues with existing workflows.

 

Let me know how you get on with the fix! :)

 

Cheers,

Andrew

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...