I am trying to run a keyboard shortcut on login to set the state of an application's windows. This macro works perfectly if I:
Trigger it manually or
The application is launched manually.
However, it does not run on system startup and login which leads me to believe that I have set the triggers incorrectly. Can anyone please show me where I went wrong?
Assuming that you have OfficeTime set to automatically launch at login, you Macro should work (it already has a pause that waits for OfficeTime to be running). But maybe you need to add another pause, that waits for its front window to exist (I don't have OfficeTime so example is with Premiere Pro)
You could also add an Action at the at the very start that specifically launches your OfficeTime Application.
The likely cause of this is that Office Time is launching before the Keyboard Maestro engine, thus Keyboard Maestro would not see the event. You could try adding the At engine launch trigger, though when doing this, you might also want to add an if statement to check if the program is already running.
Are you sure of that? It might perhaps be running as intended but, because of all the other goings on at startup/login, OfficeTime isn't the frontmost app when the macro unpauses or windows haven't opened yet so the keystroke does nothing.
You can check whether the macro runs by looking at the Engine log (you can get to the KM logs folder from the Editor's "Help" menu. And you might have to add an "Activate: OfficeTime" action to make sure it is at the front along with a "Pause Until: Front window exists".