Skip to content

Commit

Permalink
RightClick: Work on the Desktop again
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorgalvao committed Aug 4, 2021
1 parent 11a8bde commit 9cfa0bc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions RightClick/README.md
@@ -1,3 +1,3 @@
Even though a [native solution](http://stackoverflow.com/questions/9171613/right-click-shortcut-for-mac-lion-os) exists, it suffers from a big flaw: it right-clicks where you cursor is, not what you’re selecting. This workflow (or [gist](https://gist.github.com/vitorgalvao/6663126), if you prefer it as a Service) addresses that limitation.
Press a shortcut to simulate a right click in the Finder and use the context without leaving the keyboard.

Starting with Mavericks, it only works inside Finder windows, not on the Desktop.
[A native alternative](http://stackoverflow.com/questions/9171613/right-click-shortcut-for-mac-lion-os) exists but suffers from a major flaw: it right-clicks where you cursor is, not what you’re selecting. This workflow (or [gist](https://gist.github.com/vitorgalvao/6663126), if you prefer it as a Service) addresses that limitation.
Binary file modified RightClick/RightClick.alfredworkflow
Binary file not shown.
26 changes: 17 additions & 9 deletions RightClick/source/info.plist
Expand Up @@ -173,13 +173,21 @@ fi</string>
<key>escaping</key>
<integer>0</integer>
<key>script</key>
<string>tell application "System Events" to set frontApp to name of first process whose frontmost is true
<string>tell application "Finder"
if not frontmost then tell me to error "Finder is not the frontmost app"
tell application "System Events"
tell application process frontApp
set _selection to value of attribute "AXFocusedUIElement"
tell _selection to perform action "AXShowMenu"
end tell
set selected_items to the selection
if selected_items is {} then tell me to error "Nothing selected!"
set on_desktop to (insertion location as alias) is (path to desktop folder)
end tell
tell application "System Events" to tell process "Finder"
if on_desktop then
tell group 1 of scroll area 1 to tell (image 1 whose value of attribute "AXFilename" is the name of (item 1 of selected_items)) to perform action "AXShowMenu"
else
tell value of attribute "AXFocusedUIElement" to perform action "AXShowMenu"
end if
end tell</string>
<key>scriptargtype</key>
<integer>1</integer>
Expand All @@ -197,9 +205,9 @@ end tell</string>
</dict>
</array>
<key>readme</key>
<string>Even though a [native solution](http://stackoverflow.com/questions/9171613/right-click-shortcut-for-mac-lion-os) exists, it suffers from a big flaw: it right-clicks where you cursor is, not what you’re selecting. This workflow (or [gist](https://gist.github.com/vitorgalvao/6663126), if you prefer it as a Service) addresses that limitation.
<string>Press a shortcut to simulate a right click in the Finder and use the context without leaving the keyboard.
Starting with Mavericks, it only works inside Finder windows, not on the Desktop.</string>
[A native alternative](http://stackoverflow.com/questions/9171613/right-click-shortcut-for-mac-lion-os) exists but suffers from a major flaw: it right-clicks where you cursor is, not what you’re selecting. This workflow (or [gist](https://gist.github.com/vitorgalvao/6663126), if you prefer it as a Service) addresses that limitation.</string>
<key>uidata</key>
<dict>
<key>0C93966D-6C96-4BEA-97DE-F248C106FB12</key>
Expand Down Expand Up @@ -229,7 +237,7 @@ Starting with Mavericks, it only works inside Finder windows, not on the Desktop
</dict>
</dict>
<key>version</key>
<string>20.1</string>
<string>21.1</string>
<key>webaddress</key>
<string>http://vitorgalvao.com/</string>
</dict>
Expand Down

0 comments on commit 9cfa0bc

Please sign in to comment.