Jump to content
Sign in to follow this  
Tsunami

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

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.

Share this post


Link to post
Share on other sites

@Tsunami with both hotkeys, I'm seeing the full path copied to the clipboard. If you add in a Debug utility immediately after both hotkeys, what do you see as the output in Alfred's debugger?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
Share on other sites
Sign in to follow this  

×