How to make a Macro to Open a File in a Specific App?

Here's what I am trying to achieve: I have a bunch of video files that I would like to instantly convert to m4a. I have an m4a converter app. It's a few clicks to have to "File > Open With..." and find the App for each. I'd love a Macro where, upon pressing a hot key trigger, the files instantly are opened in that app (and subsequently converted automatically to m4a, which the app does the moment it is opened with a file).

The post by "Julie" :robot: has been flagged as spam. (AutoHotKey indeed..!)

You write of "a specific app", but you don't specify the app! :thinking:

Let us know. I may have a solution that is ready to go, but it depends on the app…

Have a look at the "Open a File, Folder or Application" action -- note that you can choose the application to use when opening a file:

image

All you need to do now is get the file path into the "Open" field. If you are selecting the file in the Finder then look at the "FinderSelection" token.

If you want to process multiple selected files at the same time, look at the "FinderSelections" token (note the extra "s") and consider how you would use the values in that, along with a "For Each" action, to feed the paths one at a time to the "Open" action.

KM is basically about putting (relatively) simple actions and tokens together in a sequence that does what you want. Once you've got the basics, the world is your oyster. so haave a go, and shout if you get stuck.

Thanks! This helped a lot! Unfortunately, if multiple files are selected in Finder, this operation does not seem to work. Is there a workaroumd?

See the For Each action:

( adjusting, of course, the Open with selection )

@ComplexPoint has given you the "proper" answer, letting "The Finder's selection" in a "For Each" action do the work for you.

More generally, if you look at the list of tokens on the Wiki you'll see the one after %FinderSelection% is %FinderSelections%, plural (although it is at the top of the next column, so easy to miss). Useful for when you aren't going to use the paths in a "For Each", and introduced in KM v10.

This worked, thank you!