One of my apps (Rumlog for Ham Radio) normally requires about 4-6 open windows while in use. They tend to appear randomly across various desktops on my Mac, obscuring other apps, and even obscuring its own windows. Wondering if there is some action that would open the required windows, place them in a selected desktop and adjust their size/position according to my own preferences.
The is no one Action that will do all that, but you could write a Macro to do most of it. Since Apple has not exposed the Desktop APIs, neither KM nor any tool (including scripts) have access to Desktops.
But you could open a different/new Desktop, and then have a Macro that launches the app and arranges the windows.
Here's a simple Macro that will move and resize the windows based on either Window Title (as currently designed) or Window Index (shown in the disabled Action). Maybe you can use this to get started.
==You will need to change:==
- The App that is activated and in the Pause Until
- The two magenta colored Actions that set:
- The Title of the window to be matched/set
- The Position and Size of the window
==UPDATED==: 2019-09-08 17:20 GMT-5
- Revised Macro to set position and sizes based on frame of target screen
MACRO: Rearrange All Windows in an App Based on Title [Example}
**Requires: KM 8.2.4+ macOS 10.11 (El Capitan)+**
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))
#### DOWNLOAD Macro File:
<a class="attachment" href="/uploads/default/original/3X/d/8/d81887e7ba37c984fab87b6d085821c4740aa03a.kmmacros">Rearrange All Windows in an App Based on Title [Example}.kmmacros</a>
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**
---
<img src="/uploads/default/original/3X/6/0/60d273ea48aaa8a8855e4a1207cb1896200981e9.png" width="599" height="1704">
`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
### Questions?
Thank you. For the most part, the individual actions function when activated manually from within the gear icon in each of the macro steps. However they don't seem to want to work as a linear set of actions. The try button simply produces the an error message: "could not find target application in macro".
Also wondering why one of the actions in your Macro that is greyed out; I'm unable to edit it or delete it. Finally I created a text string "asdf" as an experimental trigger in the first step, however that doesn't seem to produce any action at all. My apologies for all the rookie questions, I'm certainly on a learning curve here!
Sometimes that will work, but most of the time you need to run the entire Macro for the variables to be properly set. You can do this by clicking the "Run" button at the top of the Macro edit panel:
Did you follow my instructions?
That means the Action is disabled. Just click on the Gear menu and select "enable"
Using Typed String Trigger is probably a bad choice for this macro, since you are unlikely to be in a text area when you need to trigger it. Best to assign a HotKey trigger.
No problem. Maybe this will help.
Getting Started with Keyboard Maestro
- Read the Quick Start.
- This is essential to become familiar with KM terminology
- Do the tutorial (Help ➤ Tutorial) in the KM Editor.
- Gives you a live walkthrough of creating a macro in the KM Editor
- Review/Browse the Available Macro Actions
- For Help with an Action in your Macro, click on the gear icon at the top right of the Action, and select "Help"
- Search the Keyboard Maestro Wiki for detailed help.
- Start small, and grow your macros organically.
- Be prepared for some trial and error in the beginning.
- Make good use of this Keyboard Maestro Forum
- Checkout these Great Resources
- Search for existing macros
- Post your questions/issues if you get stuck
- Be sure to first read: Tip: How Do I Get The Best Answer in the Shortest Time?
For more help, see Getting Started with Keyboard Maestro and the Forum .
Thank you so much! Using the run button at the top everything seems to work, with the exception of the hot key. I've tried several combinations so far, but I'm sure I'll find the answer to that in the manual. Again, thanks; much appreciated!
What do you mean by it doesn't work?
Have you assigned a hotkey like this:
Thinking this might be your problem here:
Make sure the macro group containing this macro is enabled, and then see if you can't still use the hotkey.
Indeed, I didn't notice that macro was part of a disabled group. Problem solved! Thank you!