Logic Pro X: Load a file based off Tag

Hi there,

I have a pretty awesome macro built but I want to make this so it can run multiple files without me having to sit here. One step I need to do that is to have it select the next file that DOES NOT have a "Green" tag. See picture below, please:

Consequently, I would also like to "Tag" a file once I have completed this task. Anyone here able to help me, please?


Hey Josh,

Can you drag and drop files from the Finder onto Logic Pro's Dock icon to open them?

Depending upon your answer I have some suggestions.


I suppose you could, but the Macro I have built now works based off of opening a Logic Template file/session prior to importing a MIDI file. So, I don't think (off first thought) it would work. :grimacing:

Run this from Apple's anemic Script Editor app (or better yet Script Debugger), and see if you get any output.

tell application "Finder"
   set itemList to (first item of front window whose label index is not 1) as alias
end tell

Green Tag Logic Thingy.kmmacros (22 KB)

Macro screenshot

You can use %Variable%Local__FileChoice% to further manipulate the file.


First off, thank you! I realize I probably sound like an idiot and that you probably just gave me all I need, but it's not working for me. :pensive: Do I need to re-write/add the exact folder name for the "Set Folder Path"? I would love to "learn how to fish" and not just be getting fed the fish... however, I know I never would have done this on my own, so thanks so much! I just don't want to waste your time!

If you post your macro it will be a lot easier to advise you on what to do, but in broad terms... The green action is there for you to establish the path of your MIDI folder. If you already have this set to a variable in your macro, you can just pop that variable in instead.

All the macro I posted does is looks through a folder (whose path is stored as Local__FolderPath) for the first file without the tag "Green", sets its path to a new variable (Local__FileChoice) for ease of readability (you could equally just use Local__File) and then tags the file "Green".

I see, alot of that went over my head but I think I get your drift. How do I go about publishing my Macro? There's still more I want to do (that both I know how to do, might know, and have no clue, lol so don't judge me :joy:)

Logic MIDI Fixes.kmmacros (45.7 KB)

You can see that I figured out the "Green" tagging thing recently :blush: at least, the ending part. Not the beginning part what this whole thread is about...

Can you briefly outline what you want the macro to do?

I am trying to make something that saves me time at work.

It's already doing that, I am just trying to see if there's ways for me to fully (or close to fully) automate a very time intensive project.

It involves changing MIDI start times in Logic from old MIDI files. If my computer could do this overnight while I slept, that would be the dream. However, I am quickly finding different time signatures require human oversight. I might be able to program something like that, but I also honestly might just be okay where I am at.

Sorry, the idealist in me keeps wanting to take this to "the next level" and see how much can be done. I appreciate all you have done for me so far, please don't feel you need to spend anymore time on me.

Do you work for Keyboard Maestro?


What I meant was:

Can you tell me what steps you want to carry out?

For example:

  • Import MIDI file into Logic
  • do something to it (be specific)
  • save it somewhere
  • delete it from Logic
  • import another
  • etc...

This is the rough outline, sorry for misunderstanding earlier. I bolded the one item that is the one I don't know how to do. All the others I think I could figure out if I already haven't.

  • Open Logic
  • Enter Full Screen
  • Import MIDI file (check for next "non-green" one in "MIDI Files" folder that auto opens in Logic window)
  • Do stuff to it in Logic (I won't bore you with the many details as I can probably do this, although I may need help with "If" statements later on...)
  • Export MIDI
  • Mark as "Green"
  • Quit Logic
  • Start again

Actually, if there was a way to save it as a specific title based of a section in Finder that might be cool, too as that's more automation. This would come right after "Export MIDI". I want to reiterate, I probably don't need to waste anymore of your time with this. I have already saved myself loads of time with what I have. :blush:

After changing the Source and Destination folder paths in the green actions, the macro below should import and export your untagged midi files and then tag them. I've disabled the group that actually operates on the MIDI in Logic, so you can try it out first and make sure it's reliably importing/exporting/tagging the files.

You wouldn't bore me. I'm genuinely curious and, as ever with automation, I wonder if there might be a simpler way to do things.

Do you mean "selection"? I've opted for naming them the same as the source files but in a different folder. Of course you can always change the typing action to include something that delineates them from the originals if you like. Something like "- FIXED":

%Variable%Local__DestinationPath%/%Variable%Local__FileName% - FIXED%Return%

Logic MIDI Fixes.kmmacros (80 KB)

Macro screenshot

DUDE! You just made it work!! I am so psyched about this! Awesome job! The magic you have done to the loading process combined with the stuff I am doing in Logic is perfect! (Well, for now :blush:)

I have a strange feeling I am going to want to keep iterating on top of this - I have done a little bit every day and it's a real joy to see something finally come to fruition. This app is SO cool! I cannot thank you enough!

Maybe sometime I could take a video or something to show you what is happening. :blush: