Turning on Projectors with AppleScript Delay?

I have two projectors that I turn on using AppleScript. The question I have is that when using this Macro, one projector turns on super quick but then there is like a 30 second delay before the second projector turns on. The delay happens the exact same when I turn the projectors off as well.

Is the delay with Keyboard Maestro or AppleScript?

Thank you!

Left-Right Pano On Applescript.kmmacros (5.1 KB)

As those are just shell scripts, you could test the AppleScript part of it by creating a new macro that removes AppleScript from the loop. I don't want to guess wrong at the final form of that shell script line after all the quoting, but the basic structure would look like this:

That would run the command twice, once for each projector, assuming the shell script part can be figured out without the extra variable quoting that won't be needed.


As Rob notes, they are just shell scripts, so you would be better off using the Execute a Shell Script action.

In either case, if you configure the action to run asynchronously, then both would run at the same time - presuming that does not cause any problems that might resolve your issues.

1 Like

I just figured out how to execute the script asynchronously! It now works pretty much instantaneously!
Thank you both for your help!!

Thank you for the suggestions @griffman and @peternlewis! I did try your macro suggestion @griffman and haven't been able to make it work. When I put exactly what you put as a new Macro, two pop-ups came up but nothing happened with the projectors.

As to running everything just as a shell script, I did try that. Same problem with waiting ~30 seconds or so between scripts. @peternlewis How do I configure the action to run asynchronously?

1 Like

Can you show us the shell command that's running, as it looks if you were to type it directly into Terminal?