I'm using Dorico (music engraving app) but this probably applies to many apps.
When going through 'save as' dialogs and the like, many apps default to the folder the document is in, or the last folder opened by the app, or the last folder opened by the file. Usually, I just want to save to the same, static location – is there a good way to deal with this?
I've been using a hacky but exhaustive 'found image' solution that uses 'Default Folder' app, but perhaps there's a better way? (There may even be a better way in Default Folder, I'm just right up against a hellish, hellish deadline and can't think!!!).
There may indeed be. If you are willing to assign a KM hotkey to the "Save As" menu item, then that hotkey can bring up the Save As window, and then it can press the "Where": button with this action:
And then it can press the first letter of the "static folder" where you want the file to be saved, then it can press the "Save" button. But to make this work, you may have to give your "Static folder" a name whose first letter does not appear as the first letter of any other folder that appears when you click the Where button. In other words, perhaps your "static Folder" need to have a name that starts with something unusual, like a Q, Z, J, or underscore. Does your static folder already begin with a unique letter, or are you willing to give it a name with a unique letter?
Of course, I also see Nige on these forums today, and he usually comes up with better answers than I do.
The best way is possibly Default Folder X -- I believe you can set (and easily change later) the default folder on a per-application basis.
The usual way in KM is to bring up the dialog, then "Keystroke: ⇧⌘G" to bring up the "Go to folder..." dialog, Paste in the path to your default folder, and "OK" to go back to the dialog with the folder set. The specifics vary by OS version, but something like:
If you search the Forum you'll find some excellent posts doing this better than the above
But the quickest, easiest, way? Add the folder to your Finder window sidebar -- it'll show in every "Open..." and "Save..." dialog and you just have to click it to jump there...
I'm never quite sure how long to set those pesky pauses. Sometimes they work well, but then some heavy CPU or something and macros fail. I'm assuming there is a fairly large delay when KMgoes analysing a whole screen for found images which makes delays better if you can use them. Anyway, thanks responses!
Start with Pauses -- normally a second or more so I can see what the dialogs are doing
Watch for something I can use to replace each Pause -- something that Image Detection can pick up, a button becoming enabled, a menu item changing, or similar
Replace each Pause with a Pause Until, using a Condition that utilises what was spotted in step 2
When driving the "Save" dialog you can't use the "Paste" menu item's availability to determine if the "Go to Folder" box is ready because you can also Paste into the file name box (you could use it if you were opening a file). But you can use the "cancel cross" in the "Go to Folder" field:
The delay after Pasting into the "Go..." field is trickier -- you generally don't need one for an existing local location, but you might need longer if saving to a mounted network volume. Or you might be able to do something with Image Detection -- if you finish your path with a / (to disqualify items in the same location and whose names start with the target's name, eg ~/Test/ will only show the folder ~/Test and not ~/Test 2) and waiting until only one item is listed...
Not really. And you generally don't need to scan the whole screen anyway -- just the front window or similar known area.
You should be able to set that up in Default Folder X to do that without the need for Keyboard Maestro. Open DFX and select “Folders” from the menu at the top of the window that appears. Add the desired target folder for the first column; and select “Dorico” for the second column; set the third column to “all”; set the fourth column to “always”.
This example uses TextEdit because I don’t have Dorico.
It's labelled "Where:" when you have the "simplified" versions of the Open or Save dialogs, as in @Airy's screen shot. Expand the dialog to the full-fat version (the down-arrow button just above the right red arrow in the screenie) and the label disappears, though the button's actual title remains the same.