@cfriend and @cands:
My sincere apologies for the very long delay in publishing this macro.
It has been over 2 years, and I have been using it every day, and for much of that time without any further issues. However, if you have an app that uses highly non-standard windows, then this macro could fail.
Knowing that, if either/both of you would like to be my final Beta testers, I'll be glad to share with you. In fact, I will go ahead and post below. If you choose to download/install it on your Mac, you will do so knowing it is STLL IN BETA. I don't think there could be any hard to your KM or Mac, but one never knows for sure.
I hope you find them useful, and I look forward to your feedback.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BETA 1 Release of Move Mouse Macros
This is actually a macro set of two macros:
-
@MOU Move Mouse to FrontMost Window When Window Changes
-
@MOU Update List of PRESET Mouse Positions Relative to Window
Key Notes to Keep in Mind
- Both of these macros were uploaded with Macro Triggers in place, although the Macros were disabled.
- Since Macro #1 is triggered by any change of windows, be prepared for that.
- A red circle will flash briefly showing the new location of the Mouse
- In the beginning, the first Macro will be a bit of a PITA, since it needs data for every unique Window Name of every app. When you first bring a new window to front, it will prompt you for the data it needs.
- So, before you enable these macros, please set aside a few minutes (at least 10-15 min) to go through all of your App and app Windows to complete the setup phase of the Macro.
-
OR, If you prefer, you can keep Macro #1 disabled, and take your time visiting all of apps and windows.
- When each new Window is frontmost, trigger the companion Macro (default trigger: ⌃⌥HOME) to collect/set the data that is needed for Macro #1.
- Then, when you are ready, you can enable Macro #1 to start having the Mouse move to each window as it is activated.
- Finally, as I wrote these macro over two years ago, they are not my best work.
- So you may find some approaches less than optimal
- I have learned much about KM, and KM has greatly evolved, since then, so were I to write these macros today they would probably look a lot different.
- But they seem to run well-enough now, at a reasonable speed, so I'll leave them alone for now except to find any issues that are found.
As always, please feel free to post any questions, issues, comments, and/or suggestions concerning this macro.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Setup Global Variables
- You need to create a global KM Variable "DND__PauseStd" and set it to "0.1".
You can do this in the KM Editor Preferences > Variables panel.
MACRO #1: @MOU Move Mouse to FrontMost Window When Window Changes
~~~ VER: 2.2 2019-06-01 ~~~
DOWNLOAD:
@MOU Move Mouse to FrontMost Window When Window Changes.kmmacros (138 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.
ReleaseNotes
Author.@JMichaelTX
PURPOSE:
- Move the Mouse to Follow Activation of Different Window
This Macro is one of two Macros in a Companion Set:
-
@MOU Move Mouse to FrontMost Window ... (this macro)
-
@MOU Update List of PRESET Mouse Positions Relative to Window
HOW TO USE:
-
ENABLE MACRO
-
Macro Group -- Put in a Global Macro Group, available to ALL Apps
-
Activate a Different Window (other than by Mouse Click)
- For Each App, you will be prompted to Set Mouse Position for Preset Mode.
- You can set Mouse Position Relative to any corner of the Window
- You can choose "None" -- Mouse will NOT be moved when in Preset Mode
- You can choose "Off" -- Mouse will NOT be moved in either Preset or Last Mode
-
Toggle MMF_Method ([PRESET] / [LAST]) -- Trigger maco by hot key ^⌥END
-
Toggle Macro On/Off -- Trigger Macro by Name
- Similar to actual Enable/Disable, except the first few Macro Actions still run
- Then Macro is Canceled
- Set PRESET Mouse Position for an App -- Trigger macro by ^⌥HOME
- This actually triggers a Companion Macro: "@MOU Update List of PRESET Mouse Positions Relative to Window"
WHAT IT DOES:
- NORMAL CASE
IF a Different Window is Activated by any Method OTHER than Mouse Click
- IF DND_MMF__Method =
- "[PRESET]"
- Move Mouse to Preset Location for that App, unless App Setting is "None" or "Off"
- "[LAST]"
- Move Mouse to Last Location for that App, unless App Setting is "Off"
- EXCEPTIONS
- IF Mouse MoveTo Position is outside of Window, set to Center of Window
- Window Activated by Mouse Click -- Do NOT Move Mouse
- Macro is Off (DND_MMF__On = FALSE) -- Do NOT Move Mouse
- Macro is Canceled for Special Cases
(see Comment "CANCEL FOR SPECIAL CASES")
- Non-standard Window
- Window changes too fast
- Certain Windows for Google Chrome
- Window is In-Process of being Manually Moved/Resized
TAGS: @Mouse @Window
USER SETTINGS:
• Any Action in magenta color is designed to be changed by end-user
• This macro uses Google Search and Google Chrome, but can be easily changed
ACTION COLOR CODES
• To facilitate the reading, customizing, and maintenance of this macro,
key Actions are colored as follows:
• GREEN -- Key Comments designed to highlight main sections of macro
• MAGENTA -- Actions designed to be customized by user
• YELLOW -- Primary Actions (usually the main purpose of the macro)
• ORANGE -- Actions that permanently destroy Varibles or Clipboards
REQUIRES:
(1) Keyboard Maestro Ver 7.3+
(2) Yosemite (10.10.5)+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MACRO #2: @MOU Update List of PRESET Mouse Positions Relative to Window
~~~ VER: 2.1 2018-12-13 ~~~
DOWNLOAD:
@MOU Update List of PRESET Mouse Positions Relative to Window.kmmacros (29 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.
ReleaseNotes
Author.@JMichaelTX
PURPOSE:
- This is a supporting, companion, Macro to "@MOU Move Mouse to FrontMost Window When Window Changes"
- This Macro Provides Two Functions, based on the Hot Key used:
- ⌃⌥Home -- sets the PRESET location for Mouse Position for a given App/Window
- ⌃⌥⌘End -- Toggles the Enable/Disable of the Main Macro, "@MOU Move Mouse to FrontMost Window When Window Changes"
HOW TO USE:
Set Preset Location for Mouse Position
- Activate (make FrontMost) the Target App/Window
- Trigger this Macro with the ⌃⌥Home Hot Key
- Follow directions on Prompt
Enable/Disable Main @MOU Macro
- From any app or window, Trigger this Macro using the ⌃⌥⌘End Hot Key
TAGS: @Mouse @Window @Location
USER SETTINGS:
• Any Action in magenta color is designed to be changed by end-user
• This macro uses Google Search and Google Chrome, but can be easily changed
ACTION COLOR CODES
• To facilitate the reading, customizing, and maintenance of this macro,
key Actions are colored as follows:
• GREEN -- Key Comments designed to highlight main sections of macro
• MAGENTA -- Actions designed to be customized by user
• YELLOW -- Primary Actions (usually the main purpose of the macro)
• ORANGE -- Actions that permanently destroy Varibles or Clipboards
REQUIRES:
(1) Keyboard Maestro Ver 7.2.1+
(2) Yosemite (10.10.5)+