Hi Folks ... I constantly "lose" my cursor when moving from monitor to monitor, or some times from one app to another. It's driving me crazy.
I sure could use some help to create a sort of "toggle on / off" KM macro.
I'm very new to Keyboard Maestro, and enjoying it very much.
I do not have any (not sure of the right words here) scripting or coding or under the hood Mac experience.
Thanks for your help.
sys prefs : accessibility : mouse and DISPLAY gives some options e.g. increase cursor size
and with KM call this action with a hotkey combo of your choice
Highlight Oval at MOUSEX(),MOUSEY(),100,100
finally for fun try
Two built-in options that may be sufficient:
- Enable System Preferences > Accessibility > Display > Shake Mouse Pointer To Locate. Once enabled, quickly moving the mouse back and forth makes the cursor much bigger. Here's a short video showing the capability in action, which is displayed early in the video.
- In that same section of System Preferences there's a slider to adjust the standard cursor size. Moving the slider will immediately show the new cursor size.
Thank you....I haven't yet worked with calling actions... not yet. Still a beginner, but not afraid to invest in learning something new.
Thanks again... I'll let you know how it goes.
I never knew this capability was even available..... I guess you cant know everything. I will be using this manually until I can use KM to automate.
Thank you for steering me to this.
Hi @ChilliDog32, I can only provide you with an Applescript with a KM macro action. But I only have one monitor.
Since I use a german macOS, please deactivate this in the macro and activate the "english version" (here red).
You can also change the size of the cursor and the display time within the Applescript.
Size 1 to 4 .kmmacros (3,5 KB)
Applelaner....Thank you very much for the Macro....this is exactly what I have been looking for. I was able to use it immediately.
It's amazing how the Replies by Jonathonl and NaOH sort of prepared me for your Reply with the Macro and instructions.
A big Thanks to everyone.
Any chance of having this macro updated for Sonoma?
I can achieve this using BTT but sometimes BTT is a pain in the…
TIA
I'm not sure what's to update? It's a built-in Keyboard Maestro action:
Assign that to a hot key, and any time you lose the cursor, just press the hot key to reveal its location.
-rob.
I don't think we're talking about the same subject. The AppleScript provided by @appleianer is to set the cursor size and not to draw circles around it. Am I right? I'm just looking for a way to toggle between default and big size cursor, with one single hotkey.
Sorry, it was unclear from your reply what you were after, as other replies involved finding the cursor, and that action is the quickest way to do that.
I'll look at the script later today and see if I can make it work on newer versions of macOS.
-rob.
Here is a link to some scripting that does this. (above my paygrade to comment further)
I'd found that earlier in my searches, but it doesn't work in Sonoma at all. It appears that scripting of the slider (at least the mouse cursor slider) is broken in Sonoma. I'm working on a workaround that's nearly there.
-rob.
That's awesome! I would rather prefer to set this in KM rather than using BTT, which again does not play well with a lot of utilities…
Yeah, I'm sorry too, I presumed the only AppleScript here was that one… All good
Here's a version that works, but I will warn you it's not ideal: It's sort of slow, because of how I had to change the cursor size value. Here's the issue: It doesn't seem possible to directly set the slider value in macOS 13 or macOS 14. That is, this line...
set value of theSlider to 4.0
...does absolutely nothing. It doesn't error out, and the script acts like the value has been set, but the cursor size (and the value on the slider) don't change.
I worked with a friend who is well versed in AppleScript and GUI scripting, and we tried all manner of methods to update the slider, and none worked. The only thing we found we could do was to increment and decrement the value, so that's how the macro works: It increments (to 4) or decrements (to 1), which does update the cursor size.
The downside is that you have to see—and wait for—each of those sizes as it scales the cursor up or down. So it will take a few seconds to run.
Download Macro(s): __Mouse Size Toggler.kmmacros (3.5 KB)
Macro notes
- Macros are always disabled when imported into the Keyboard Maestro Editor.
- The user must ensure the macro is enabled.
- The user must also ensure the macro's parent macro-group is enabled.
System information
- macOS 13.6.5 and macOS 14.4
- Keyboard Maestro v11.0.2
This macro only works on macOS 13 and macOS 14, and has only been tested with Keyboard Maestro version 11.
I can only assume the inability to set the slider level is a bug ... but if so, it's been there since macOS 13, so it's unlikely to be fixed soon. If anyone has a method that works to directly set the slider level, I'd love to hear about it! (The only other option we considered was using Found Image, which would work but require the System Settings GUI to appear onscreen each time. I'm not sure that's a net win.)
-rob.
Oh! I'm just speechless and so grateful at the same time! I will try this!
Thanks so much!!!!
Edit: Ok, tried it! It's kinda funny but when doing a tutorial video it will be strange. Just wondering how BTT does this and why there's no right tool to achieve everything… well… I'm still very grateful!
BTT may do it at a code level, where more things are possible than in AppleScript—I have no idea. I also don't know why Apple breaks code that works, as they seem to have done with the AppleScript command to directly set the value.
-rob.
Hello Emanuel (@xattr)
I would suggest to set the cursor size to the preferred Value before making tutorials.
Maybe this what @griffman is pointing at is right … BetterTouchTool uses a lot of private API‘s and it maybe could be done with Scripting these API‘s - maybe not …
But this is a complex thing though… instead of trying to find a hacky way using AppleScript Objective-C talking to these API’s (where it is possible that you would have to build a custom framework) you could also try to talk to BetterTouchTool with vanilla AppleScript syntax calling a configured BetterTouchTool action from your Macro using the BTT Action‘s JSON in the AppleScript code.
This would be the easier method - and could also be quicker than talking to System Settings … I don’t know I’m just guessing since I am still on Monterey…
Greetings from Germany
Tobias
Here's a slightly better script: I'm not sure it runs any quicker overall, but the cursor animation is smoother. More importantly, it should work on any Mac of any speed, as the delay is now based on how long it takes for the System Settings window to appear.
Just replace the script in the macro with this:
set theSystemVersion to system version of (system info)
tell application "System Settings"
reveal anchor "AX_CURSOR_SIZE" of pane id "com.apple.Accessibility-Settings.extension"
repeat until window "Display" exists
delay 0.15
end repeat
tell application "System Events"
if (text 1 thru 2 of theSystemVersion) is "13" then
set contentView to group 2 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Display" of application process "System Settings"
else
set contentView to group 3 of scroll area 1 of group 1 of list 2 of splitter group 1 of list 1 of window "Display" of application process "System Settings"
end if
set theSlider to slider 1 of contentView
if value of theSlider is 1.0 then
repeat 10 times
increment theSlider
end repeat
--say "Big Mouse" using "Ralph"
else
repeat 10 times
decrement theSlider
end repeat
--say "Tiny Mouse" using "Ralph"
end if
end tell
quit
end tell
-rob.