[SOLVED] Run macro triggered by external shell script file

In Carbon Copy Cloner we have the option to run a shell script file (.sh) after the backup task.
I have a macro that checks if certain disks/volumes are mounted and I would like to create the .sh file to trigger that macro, but I can't find anything online or the forum related to that.
I know how to create an AppleScript file that triggers a macro using the UUID, but not a shell script file.

Would it be considered cheating to use osascript? :slight_smile:

-rob.

Based on my basic knowledge, as long as CCC is able to read the script and run the macro, anything goes (even cheating :wink: )
Would that be written in a .sh file?

Have you seen the documentation for the Keyboard Maestro CLI tool?:

https://wiki.keyboardmaestro.com/trigger/keyboardmaestro

2 Likes

That looks even simpler! And I didn't know about it, that's really handy—thanks!

-rob.

If you look at the trigger section at the top of your macro and click the Or by script pull-down you'll see this:

image

Just click on any of them and KM will show you the corresponding code you need to trigger the macro using a script. Here's the shell script one for example:

Note: the UUID shown is for the specific macro you're looking at, so you don't even have to figure that bit out :wink:

1 Like

I didn't know about that. Thanks for sharing. Will save that on my notes.
Meanwhile @tiffle offered the solution I was looking for.

1 Like

Thank you so much!
Exactly what I needed. Saved to my notes so I don't forget this :wink:

1 Like