How can I run a script when my mouse pointer touches the left edge of screen?

Does anyone know of a way to automatically run an apple script when my mouse pointer touches the left edge of the screen?

This would be similar to the stock “Hot Corners” feature, but I specifically want the trigger to be anywhere along the left edge of the display, and then run a script.

The closest thing I’ve found is BetterTouchTool’s screen corners triggers, but it doesn’t have the left/right edge of screen options.

Thanks in advance!

Interesting question. Alas, I was not able to find a tool with “screen edge” as a trigger.

Clearly moving the cursor to the screen edge can be detected and acted upon, as the Dock and utilities like Yoink show. All that would be needed is for BTT or KM to add this as a trigger (hint, hint).

1 Like

Thanks, @MevetS :grinning: I’m glad that I’m not overlooking an obvious solution. I’ve submitted the screen edge trigger as a feature request to BTT so hopefully, it will be added in the future.

If anyone knows of a way to achieve this in the meantime, please let me know. Thanks!

1 Like

And today is the day!

From the latest BTT release notes:

  • Added “Move Mouse To Left Edge”, “Move Mouse To Right Edge”, “Move Mouse Away From Left Edge” and “Move Mouse Away From Right Edge” as new triggers to the “Automations, Named & Other Triggers” section

:slight_smile:

1 Like

This is awesome! :+1: Thanks for replying with an update.

I tested it out and it felt a bit slower than the response time I get from macOS Hot Corners. The BTT developer Andreas explained that for these triggers, the mouse position is checked every 0.2 seconds. However, you can change this “check interval” timing via a terminal command:

defaults write com.hegenberg.BetterTouchTool BTTMouseCheckInterval 0.1

BTT needs to be quit/relaunched for the change to take effect. He said that the command is supported in v4.033 and newer.