How can I control the File Open dialogue box of a (Java) app and open the document Target.docx on the Desktop?
The dialogue box:
How can I control the File Open dialogue box of a (Java) app and open the document Target.docx on the Desktop?
The dialogue box:
It looks like a standard macOS dialog -- if it always opens in the correct folder try an "Insert text by typing" action, using the file name, to select the file then "Keystroke... Return" to open it.
If you want to be explicit about the complete path, then
...should do it.
At the risk of repeating what Nige has helpfully said, here's a general-purpose subroutine to trigger and fill a Go To dialog, which you can use with any standard macOS Open/Save dialog.
You could then use an "Execute a Subroutine" step in your macro with a parameter of ~/Desktop/Target.docx
Some of the pauses may seem quite long, but these are what I've settled on after a few months' of use to make it consistently reliable.
FWIW, I script Default Folder X for this sort of thing. Works perfectly, whereas I saw some inconsistent behaviour with the native keyboard shortcut when used programmatically.
Oooh - thanks (again!), Neil That might explain why I needed such large pauses.
I have Default Folder X and hadn't realised it was scriptable - will "borrow" your macro
A while ago, I posted a macro on this topic, which might be helpful.
Thank you @Nige_S! I must admit that I wasn't ware of the keyboard shortcut ⌘⇧G