Help Needed with Startup Macro and Timing Issues

Hi all,

I have previously set up a nice macro that I use to start things up. Basically, it opens a number of applications and sets their window position on either my main or secondary screen. In addition, some app windows will open on another Space.

For the most part things are working very well. My issue is properly timing the various macro steps so that everything opens correctly. Sometimes things randomly get messed up and apps open in the wrong Space or the macro gets stuck in the middle and does not complete. Mostly I am using "pause until all conditions are met" however sometimes this does not work as expected. So additionally I have added pause for XX seconds when needed.

I imagine if I set up the "pause until all conditions met" better - then I wouldn't need to pause for xx seconds.

The basic macro - repeat for all apps

1 - activate application
2 - move and resize Front window
3 - pause until conditions are met

  • conditions...

usually just = the front window of "APP" exists
or
This application XXX is at the front

I am a bit confused how to get all this working properly since some applications do have a front window and some do not (just open dialogue). Also, sometimes things get slowed down because an external spinning Drive needs to spin up which might throw off the timing somewhat.

To jump to the various spaces prior to opening apps for that space I use = type the xxx keystroke. Do I need to pause to wait for the space to show up?

Q: Is there a best practice to setup pauses so that this macro will always work as expected?

I would appreciate any help to show me the best way to get these applications to open and properly pause for the window to be set up for all the various applications and spaces.

Post your macro so we can see what's going on.

1 Like

Hi, @dealtek. You might find @Zabobon's thread helpful: Zabobon's Dynamic Workspaces v5.02 2022-04-14 - Macro Library - Keyboard Maestro Discourse

If you are using multiple Mission Control Desktop Spaces, then I have some macros that you might find useful:

2 Likes

In addition to the above (and reinforcing @noisneil's suggestion that you post your macro):

It looks like you have steps 2 and 3 reversed -- normally you'd pause until the front window exists (or whatever) and then move/resize it.

If you have to wait for the volume to appear in the Finder there's a specific "Volume with name 'X' is mounted" condition in the "Pause until" action. If it's already mounted but just a bit slow to get going when you try to access files then you might have to find another method, but there's usually something you can test for (like "can I list the files in the top directory yet?").

3 Likes

Thanks Very Much for the info - noisneil _jims and Nige_S. I will look into this asap.

1 Like

BTW: I'll be checking out the helpful advice today.

Hi, Sorry for the delay. I am posting this macro as an image and will post the macro also if needed (if some one can let me know the best procedure how to do that).

This macro does seem to be working ok now - but I have a few questions:

1 - How best to pause until APP Conditions are met?

A = the front window exists
or
B = This App XXX is at the front?

2 - Should I pause before or after spaces change - or is there a better way?

You are correct - my fault - I wrote it wrong. Usually I would have it as you suggest.

Thanks for al the help. I am still curious about this (see image):

1 - How best to pause until APP Conditions are met?

A = the front window exists
or
B = This App XXX is at the front?

2 - Should I pause before or after spaces change - or is there a better way?