Navigate to Path in Dialog

I wanted to learn how to create a plugin, so here's my first simple offering:

Navigate_to_Path_In_Dialog.zip (6.0 KB)

This will navigate to the specified path when in macOS file dialogs.

Installation:

Drop the .zip archive on the Keyboard Maestro application dock icon.
To uninstall, remove the plugin folder from ~/Library/Application Support/Keyboard Maestro/Keyboard Maestro Actions.
To update, remove the plugin folder and then re-install.

7 Likes

Hello Neil (@noisneil),

Congratulations on making your first own Custom PlugIn Action for Keyboard Maestro.

:clap: :clap: :clap: :clap:

This is something I’d love to have in my PlugIn Collection (60+ PlugIns and growing…) because it looks quite useful. :woozy_face:

I’d encourage you to give us more background information on:

  • why do you think this PlugIn Action is worth downloading,

  • what it does exactly and

  • how we PlugIn - Nerds and Lovers and all the others interested in PlugIn Actions could and have to use it in our Macros.

As always thanks again :pray: for making and sharing the great Stuff.

Greetings from Germany :de:

Tobias

You can use it in your macros whenever you'd like to programatically navigate in a file dialog, and I think it's worth downloading as there isn't a default KM action that does this.

Here's a gif showing the action navigating to ~/Desktop in a file dialog.

CleanShot 2023-09-26 at 09.13.47

2 Likes

Ok … you have to open the Open-/Safe-Dialog within your First and then this action comes and does the magic … this is the reason why I asked you to give us (not only me) more information about this PlugIn … because you could have written it to call the dialog and have it prepopulated with the path all in one PlugIn - like you could automate your Dialogs with AppleScript for Default Folder X by just calling the Open-/Safe-Dialog.

Yeah you’re right … there is no native Action in Keyboard Maestro which does this …

Any way… this is a great PlugIn Action - and a game changer … it would be nice to have some example Macros which show how we can and should use this PlugIn Action … and how we don’t to get the full potential out of it …

Call me pity … but think of my first thought I’ve written about in this reply above :point_up_2:

It is not always everything self explanatory….

Now I have to help my father before he gets angry …

See you later alligator - but only after a while crocodile :crocodile:

Greetings from Germany :de:

Tobias

I disagree, as dialogs can be called in many ways or may be presented without expressly being called by the user. This plugin is designed simply to navigate within them.

Here's an example:

Save File to Documents Folder.kmmacros (22 KB)

Macro screenshot

Note: The pauses are necessary at the moment, but I'm going to try to figure out a way to avoid them.

Edit: Pausing in the AppleScript that it part of the plugin is unreliable, so the pause action does seem the best option, unless someone can prove me wrong...?

2 Likes

Hello Neil (@noisneil)

Thanks for posting an example Macro …

I know about the fact that you have a lot of options to call a dialog and that’s even a factor I was talking about…

I am currently not at home and don’t have my MacBook Pro with me so there is nothing I could do helping you out until I get back home in the next days … I promise you that I will even have a look at the source code of your PlugIn when I am back in front of my Macs after coming home.

I wish you a nice evening my friend

Greetings from Germany :de:

Tobias

1 Like

Thanks for sharing! I do this in so many of my macros and it will be really nice to clean them up with this. I was also unable to do this without a manual pause, starting after I upgraded to Monterey. It worked with no pause in Mojave for me and I haven't been able to get it to work without pauses since updating.

1 Like

I use Default Folder X for this, but I always replace that with AppleScript when making macros for other people, as not everyone has it. This is just a bit neater.

Ordinarily, I'll use pauses conditional on the Save/Open/Cancel buttons, but I opted for static pauses in the example above, as for some reason the conditional pauses were unusually slow to respond. Not sure why.

I tried adding conditional loop pauses to the plugin's AppleScript, but they didn't seem to help avoid jumbling up of the path (in the Go To... sheet) and the file name (in the text field at the top of the dialog). Perhaps someone with a bit more AppleScript expertise could nail it.