Jump to content

set a Hotkey to launch a specific folder using Finder's "Go to Folder" command


Recommended Posts

Hi, I’m a power pack user. I’ve spent sever hours trying to solve this, and I think i’m pretty stuck. 

 
What I’m looking to do is to set a Hotkey to launch a specific folder in Finder using a very specific method:  More specifically I would like to run the Finder command  `Go to Folder` and open the folder that way. 
 
The reason I would like to use Go to Folder is because 1, it will prevent Finder from launching a new Finder window with the path and instead use the current open finder window. And 2, this hotkey will still work when in any applications Save dialogue that used the Finder save window. 
 
I basically want to mimic the behavior of the built in finder hotkeys like Shift+Cmd+H for ~/, and Shift Cmd+o for ~/Documents, etc…
 
Is this possible?
 
Thanks in advance. 
Edited by vitor
Normalise font size
Link to comment

@alexxhenry Welcome to the forum :)

 

Step one for this would be to work out whether there is AppleScript to run those commands, as that's the most reliable way to perform any action / manipulate Finder.

 

Once you've worked a way for macOS to do what you have in mind, you'll be able to set a hotkey trigger for your script from Alfred.

Link to comment

As @Vero mentioned, doing this properly with AppleScript is the way to go. Otherwise you’re doing GUI automation which can be finicky—if your Mac suddenly becomes slower or unresponsive, the actions you sent may not all go through, leaving you in an unpredictable state.

 

That said, I gave this a thought and you may not have a choice.

 

On 2/13/2022 at 4:06 AM, alexxhenry said:

And 2, this hotkey will still work when in any applications Save dialogue that used the Finder save window. 

 

That requirement throws away other possibilities because now you have to interact with every conceivable app, and not every app is scriptable. So GUI automation, a last resort, is your only option for this.


This should work. Edit the Copy to Clipboard with the folder path you want. But see how it relies on ⌘⇧G: it assumes you kept the default shortcut. Also note how there are a few delays between objects: you’ll need to increase those if the actions are too fast for your machine. Those are the disadvantages of GUI automation. That said, this one is simple enough that you’ll probably be covered.

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