Jump to content

Right Click — Trigger a right-click on Finder files, with the keyboard


Recommended Posts

6 hours ago, Michael Volk said:

How difficult would it be to get this working in other apps?


See above.

 

6 hours ago, Michael Volk said:

My use case is getting it to work inside of the VsCode file explorer. 


VSCode is an Electron app, meaning automation via standard macOS APIs is unlikely.

Link to comment
  • 2 months later...
On 9/23/2013 at 1:06 AM, vitor said:

A native alternative exists but suffers from a major flaw: it right-clicks where you cursor is, not what you’re selecting. This workflow (or gist, if you prefer it as a Service) addresses that limitation.

 

I have tried native alternative above (right click at cursor point through Enable alternative pointer controls). Works good. The default keyboard shortcuts F12 and not easy to change -- how can I get this key on Touch Bar (but still keep all other icons) or assign another shortcut such as Cmd+. for using it.

 

Also on right click, is it possible to get menu bar search workflow functionality ? it is so much easier to type. Should be posted in Menu Bar search workflow forum?

Link to comment
  • vitor changed the title to Right Click — Trigger a right-click on Finder files, with the keyboard
  • 2 weeks later...
  • 2 weeks later...

Hello, 

Here in 2023, I just tried this workflow and it it not working for me, I am using Ventura 13.1. I am not getting the error tone once I set up the Hotkey in the workflow, and the error tone comes back when I delete the Hotkey, which leads me to think that the workflow is getting activated but the script isn't working. Any help appreciated. 

Thank you,

Leland

Link to comment

Hello @leland,

 

7 hours ago, leland said:

I am not getting the error tone once I set up the Hotkey in the workflow, and the error tone comes back when I delete the Hotkey,


I don’t understand your steps. There shouldn’t be an error tone. Can I get a short video or a rewording?

Link to comment

When in Finder and I press ⇧⌃⌥O, this makes an error tone, of course, because that is set to do nothing. If I set ⇧⌃⌥O as the Hotkey for the workflow "Right Click — Trigger a right-click on Finder files, with the keyboard" then I no longer get the error tone when I press ⇧⌃⌥O, I get silence, which is what heppens when finder or a program normally does something from a shortcut. Which leads me to think that it's activating the workflow but the script isn't working because the item that is highlighted isn't being right clicked.

 

I recorded a video but mp4 file types are not accepted at attachments here? I could upload as a gif, but it wouldn't have the audio and error tone...

Link to comment

Alfred 5.0.6

workflow unchanged except for hotkey: https://transfer.sh/MOV9ms/Right Click.alfredworkflow

video: https://transfer.sh/1u4ysN/2023-01-03 at 22.16.13 - Peach Whale.mp4

 

Debugger output try 1:

[21:48:19.452] Logging Started...
[21:48:26.461] Right Click[Hotkey] Processing complete
[21:48:26.474] Right Click[Hotkey] Passing output '' to Run Script

 

Debugger output try 2:

[21:48:26.461] Right Click[Hotkey] Processing complete
[21:48:26.474] Right Click[Hotkey] Passing output '' to Run Script
[21:49:19.846] Logging Started...
[21:49:24.034] Right Click[Hotkey] Processing complete
[21:49:24.044] Right Click[Hotkey] Passing output '' to Run Script
[21:49:24.263] ERROR: Right Click[Run Script] /Users/leland/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/B9DDF171-354B-4DBF-A15B-42E234AB3B0B:598:625: execution error: System Events got an error: Can’t get attribute "AXFocusedUIElement" of process "Finder". (-1728)
[21:50:02.278] Right Click[Hotkey] Processing complete
[21:50:02.289] Right Click[Hotkey] Passing output '' to Run Script
[21:50:02.538] ERROR: Right Click[Run Script] /Users/leland/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/B9DDF171-354B-4DBF-A15B-42E234AB3B0B:598:625: execution error: System Events got an error: Can’t get attribute "AXFocusedUIElement" of process "Finder". (-1728)

Link to comment

I thought you might be missing some permissions (System Settings → Privacy & Security) but with selective turning off I haven’t been able to get your exact error. I can’t reproduce your issue at all. Something is different about your setup and a clue as to what is necessary. Temporarily create a new user account on your Mac, set up Alfred on it, and try again. Can you still reproduce the behaviour?

Link to comment

That got me closer, I was able to figure out that I didn't have accessability turned on. It's still not right clicking a file though, see video below for behavior,

 

Debugger output

[20:32:08.044] Logging Started...
[20:32:13.322] Right Click[Hotkey] Processing complete
[20:32:13.337] Right Click[Hotkey] Passing output '' to Run Script
[20:32:31.044] Right Click[Hotkey] Processing complete
[20:32:31.056] Right Click[Hotkey] Passing output '' to Run Script

 

https://transfer.sh/Sbo3fp/Screen Recording 2023-01-10 at 8.32.52 PM.mov

Screen%20Recording%202023-01-10%20at%208

Link to comment

Your Finder window looks weird. Where are the “traffic lights”? Try it on a new user account, something with default options. If your setup is atypical, it’s not possible to develop a fix unless I know exactly what’s weird about it that causes the behavioural change.

Link to comment

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...