I would like to create a finder window by right clicking and selecting "new finder window" similar to the right clicking to create a new folder . Is this possible through automator?
-
Is there some reason cmd/double-click doesn't satisfy [though it only works with folders, not files]?– TetsujinApr 19, 2019 at 14:58
-
Thanks Tetsujin, i should clarify. I want to create a finder window at the desktop level at the location I click– monteipApr 19, 2019 at 15:16
-
That doesn't clarify, it confuses, tbh. A Finder window is either at Desktop, or at the location you selected, it can't be both. That it 'appears' floating above the desktop is neither here nor there. Did you try cmd/d-click?– TetsujinApr 19, 2019 at 17:07
-
My apologies. if I do a command-N i get a finder window in the upper left corner of my screen. I am wondering if it is possible to that (cmd-N), with a right click– monteipApr 19, 2019 at 17:42
-
ah, no sorry - i was completely missing the point. I didn't realise you meant 'geographic' position in the screen area.– TetsujinApr 20, 2019 at 7:57
1 Answer
If you are looking to open a new Finder window with its position being the current position of your mouse location… this will accomplish that for you.
This code requires the third-party utility, Cliclick.
“Cliclick” is short for “Command-Line Interface Click”. It is a a tiny shell/Terminal application that will emulate mouse clicks or series of mouse clicks (including doubleclicks and control-clicks) at arbitrary screen coordinates. Moreover, it lets you move the mouse, get the current mouse coordinates, press modifier keys etc.
It's free to download but it's donationware, and is easy to install.
On my system I have. cliclick
in the following directory: /usr/local/bin/
. Because of this location, in my AppleScript code and in Terminal app, I need to use the full path to cliclick
to call the command. For example: do shell script "/usr/local/bin/cliclick rc:."
In AppleScript is telling cliclick
to right-click.
This works for me using the latest version of macOS Mojave.
Create a new Automator Quick Action document and add a “Run AppleScript” command to your workflow. Then overwrite the pre-existing text in the AppleScript command with this following code. Then save your file. I saved mine with the name “New Finder Window At Mouse Location.workflow”
set mousePosition to do shell script "/usr/local/bin/cliclick p:."
set mouseCoordinates to makeCoordinatesRecord(mousePosition)
tell application "Finder" to set position of (make new Finder window) to mouseCoordinates
on makeCoordinatesRecord(mousePosition)
set a to offset of "," in mousePosition
set x1 to text 1 thru (a - 1) of mousePosition as number
set y1 to text (a + 1) thru -1 of mousePosition as number
set mouseLocation to {x1, y1}
end makeCoordinatesRecord
You won't be able to access this command through “Right Click” menu but you can create a keyboard shortcut to run your new Quick Action which will open a new Finder window at your current mouse location.