Best practice for prompting user to choose file / folder?

What is the most Maestronic approach to prompting a macro user to choose a folder path or file path ?

Is it essentially to call one of the osascript ‘choose’ functions from an Execute [script|shell] action, or am I overlooking something else in the KM action library ?


Just to delegate that to Finder selections ?

( select file(s) or navigate to folder in Finder, and then run macro ?)

Selecting the file in the Finder is the best you can do with Keyboard Maestro.

Keyboard Maestro itself has no ability to ask for the file, so using AppleScript to select the file is the closes you can come.

I will probably add support for selecting a file via the Prompt For User Input action, but probably not for 7.0.

Thanks – that makes sense – and there’s a kind of elegance and economy to using Finder selections.

Here is a Macro that includes a JXA script to Choose File, that could be used with any macro.

###MACRO: Choose File to Open or Read into KM Variable @JXA