Running Tasks via Multiple Application Pipelines

Hi,

I am totally new to KM and it was recommended to run the trial version to see if it could meet my expectations. It looks extremely powerful via the options, but I haven't been able to successfully make it work the way I need.

I need it to watch a folder for a file, launch an app and load the file into the app and perform a set of subsequent tasks based on the reading of the app. More specifically, watch for an audio file -> open a loudness meter app (if it isn't already running) -> load the file into the app -> perform any subsequent task I require based on the reading given by the app.

I've tried recording a macro but it appears to be based on the position of the windows (folder, app and etc). Which makes the entire process a bit pointless b/c it won't work if any of the windows are moved.

Secondly, it doesn't seem this is really the right approach to accomplish the task.

Is this something KM should be able to effortlessly handle or no? If it should be able to fill the bill, how do I go about doing it? Again, totally new to KM and the abundance of libraries and options are a bit overwhelming just coming into it all.

Thanks

Change absolute position to window so when window moves it considers that

Everything you mention is possible via km

Ok, I'll give that a try. So recording the macro is an acceptable approach?

Yes try to record simple macros first

Not just no, but Hell No!

Do not rely upon recording for anything โ€“ it's like hunting and pecking instead of typing and fraught with misspellings...

Recording can be useful for various things like recording clicks or menu selections โ€“ but you have to understand KM a bit โ€“ before you can tweak the results as necessary to do the right thing.

More specifically, watch for an audio file -> open a loudness meter app (if it isn't already running) -> load the file into the app -> perform any subsequent task I require based on the reading given by the app.

  • How many files will be added to the watched folder at once?
  • What app?
  • What reading?
    • How is the reading presented?

If you haven't read these they're worth a couple of minutes of your time.

  • I create audio mixes using Logic Pro to a folder (1 at a time)
  • I want KM to open the YLM (YouLean Loudness Meter) when the audio file has completed writing to the folder (Could take up to 3 minutes)
  • And then load the completed audio file into YLM (drag and drop is supported)

If I could automate things after that point based on a specific value generated by the YLM app that would be great but I don't "think" KM would be capable of making an assessment of the reading since the app is UI and not a CLI. If the YLM app were able to place the readings into a file, then I suppose KM could then execute a subseqent action based on the reading but unfortunately thats not the case.

Hope that provides a bit more clarity

I'll read your tips as well. Thanks

There's also a "File analysis..." menu item, which might be easier than macroing a Drag-and-Drop. Does that work for what you want?

YLM can export to CSV, which you could analyse via KM if the CSV contains the values you need. But a) I'm ignorant, and b) there's a lot that is unavailable in the YLM free version -- so you'll have to suck it and see!

Ok I'll look into the File Analysis. Since this is all new to me IDK if that will suffice what I'm trying to do but it's definitely a starting point that I didn't have before my post. I have the PRO version so I'll explore the export file.

I think my biggest obstacle right now is understanding how and what macros I should use to interact with other apps. That's why I was going with the recording option since it seemed the path of least resistance on the learning curve for me. But I'll take your advice and try to delve a bit deeper.

It looks like "File Analysis..." is what a proper Mac program would label "Open..." -- so fundamentally the same as drag'n'dropping a file onto the window. But do your own comparison, just in case.

Unfortunately YLM isn't a standard Mac app, so you've picked a tricky thing to start your KM journey with! Without menu items to give you access to the functions you require, take a look at actions like "Move or Click Mouse", which can use a found image as a target -- that could get you into YLM's Share Sheet to do the Excel export, for example.

Man, the usability of Youlean Loudness Meter 2 as an app fails to impress...

The fact it doesn't support drag and drop from the Finder onto the Finder-icon or the Dock icon is something I'd take up with the dev.

You can't use open from the shell either...

1 Like

Bounce and Process Audio File.kmmacros (2.1 KB)

So my first post to the forum was dealing with this same task I'm trying to accomplish but a saw no way to use the recommended "Share" option when posting while targeting an already existing post. Apologies.

I've taken a stab at this and have began a macro trigger that monitors a folder for audio files created in the directory. I selected to ignore partial or changing files but I think I should probably change it to ignore partial files only so the trigger doesn't engage until writing to the audio file has completed.

Next I selected the action to open an application. So far looks good but the next step I need to happen is a drag of the audio file to the opened app and I don't see a drag/drop action.

How might I do that?

Actually you might not need to drag and drop. I don't have that app, but maybe you can open the file via its path, using the %TriggerValue% token...?

Bounce and Process Audio File.kmmacros (20 KB)

Macro screenshot

If that's not an option, you can try using the menu system to open the file:

Bounce and Process Audio File.kmmacros (24 KB)

Macro screenshot

I downloaded the free demo version for this, so I don't know if things work differently in the pro version. Hopefully it will give you an idea though.

Thanks for this! I'd already considered opening the file via the app as you'd initially suggested but unfortunately the targeted app won't open audio files. But I'll get that one a shot to see what happens.

Your 2nd macro I follow until it gets to the Type Keystroke step and below. I don't fully understand what those steps are supposed to be doing though I can make out a couple of them.

I'll try both and see where things go. Thanks!

  • โ‡งโŒ˜G opens the Go To... file navigation pop-over window.
  • We use this to navigate to the file you're trying to open by literally typing in its path, stored as a %TriggerValue% and then hitting โ†ต.
  • Lastly, we hit the Open button to load the file into YouLean.

Ah okay. I get that. Well that said and with the noted inability of the app to actually open the audio file; gets me a few steps closer but since it appears there is no actual drag/drop capability in KM.... I'll still have to figure some alternative method of getting this to work end to end.

I know recording a macro isn't ideal per comments from my previous post but I think that would be the only option I have. Which really isn't very intuitive for this type of task b/c it seems to only work if the source and target items and windows are unchanged being based off x/y co-ordinates.

Been looking into Hazel as well but seems it lacks the ability to assess a completed file from one being written. :face_with_diagonal_mouth:

Can you open a file from YouLean's menu system? If you can, you can automate it with KM. That's what my second idea attempts to do.

There absolutely is, but it's what I'd call a 'brute force' method, and wouldn't be my first port of call. We can get to that if the menu idea is a non-starter.

Hazel will work, but you'll still have to solve how to open the file once you have its path.

Don't worry, this is all doable.

So your macro appears to work up until opening YLM but for some reason the File -> Analyze File operation never fires. Also noted that even if I manually open that menu the next condition of the "Open button" being enabled won't happen until navigation to the actual file and its selection is made.

Any suggestions?

Btw, I also acknowledged and enabled safe execution via KM popup for imported macros

Is YouLean selected in the Pause Until action?
Also check the Menu action. I set it up to reference the free version so I'm not sure if it needs adjustment.

Try changing it to "exists" rather than "enabled".

Yes. But I did try changing to "exists" which appears to have fixed the problem. So now any time a new file is dropped in the folder it launches YLM, opens the file analyze and loads the file correctly.

There are still a couple of steps I'd like to figure out how to accomplish but this is definitely a very good start.

I don't suppose there is a way to read the values on specific areas of the YLM UI and run additional macros based on the values is there? Or any UI for that matter.

My initial thought was to export the readings and then run a script that would execute additional steps based on if then else.... but the YLM app only exports graphical content in PDF, PNG and etc. Reading through the forum it appears there is a way to extract content from a PDF file but it seems creating a macro for that type of task is a bit more advanced than I'm ready to tackle w/o being more familiar with the basics.