I’ve just started with Keyboard Maestro a week ago but I absolutely love it. Tons of things to learn. I am currently hitting a wall creating a macro that multiple variables need to be passed.
The content of the macro
I want to use ImageMagick command tool to create a collage from selected images.
Ideally I want to be able to handle not only two images, but any amount of images selected, to pick every image’s path and put them between “montage” and “-geometry”
What I currently have
I searched both wiki and google, but could not find the method to pass multiple variables.
When I tried to run shell script with plain text, it seems like KM was not picking up the path. So I thought of store every path into the clipboard and paste them in the reverse order in order to pass the variables. I currently set the macro to paste last two paths, but have no idea how this would work for any amount of images.
I must’ve done something wrong as the script would not work. The macro always got canceled.
To test if the variables are correct, I added a text box to display them.
Because it's verbose, harder to read, and more prone to error – especially when you call multiple commands in the same script.
It's a better practice to set a $PATH environment variable in Keyboard Maestro (ENV_PATH) for shell scripts, OR to export the path once in a given script as @ying did in his example macro.