Macro to Automatically Create Open File Macros

You're welcome. Glad to hear it's working well for you! To answer your questions:

  1. It does complicate the macro a little to accommodate Path Finder as well, but not too much. You mainly need to add another AppleScript to get the Path Finder selection, something the inimitable @ccstone (who no doubt will weigh in on at some point with a superior all-AppleScript solution, as is his wont :slightly_smiling_face:) provided in a prior topic.

  2. You were close: the macro syntax is just missing an = after macro. That said, how are you acquiring the UUID for the macroUUID variable? As far as I know KM only provides tokens for getting the UUID of currently executing macros, so getting the UUID of the newly created Open File macro requires doing so through AppleScript. In the meantime, since getting the newly created macro's UUID requires AppleScript anyway, I decided to modify the last part of the script in the macro I uploaded to set the clipboard to the information you wanted, i.e. the file's name, parent folder, and the newly created macro's trigger URL:

Create New “Open File” Macro and Copy Macro URL 1.1.kmmacros (6.2 KB)
image

While I was at it, I also added a notification at the end to visibly indicate that the macro had completed, since as it's currently written there's no other indication besides checking the KM editor or the clipboard as to whether or not it succeeded. As always, feel free to modify as necessary to suit your needs (though if you have further questions, do please upload the full macro file as well, even if you choose to only post cropped images. As I said before, it makes it much easier to diagnose any issues if we have full access to the macro as you're currently using it).

1 Like