
MOJAVE BETTERSNAPTOOL LICENSE
Cover image used under license from .Ĭreated & Printed in the United States of America. All other trademarks are the property of their respective owners. Apple, the Apple logo, macOS, and macOS Mojave are trademarks of Apple Inc., registered in the U.S. Customizing macOS Mojave is an independent publication and has not been authorized, sponsored, or otherwise approved by Apple Inc. The only exception being use by a reviewer who wishes to quote brief passages in connection with a review written for inclusion in a magazine, newspaper, website, or broadcast, or the use of small excerpts for academic purposes. The scanning, uploading, and distribution of this book via the Internet or via any other means without prior express written permission of the author is prohibited. No part of this publication may be reproduced or transmitted in any form or by any means electronic or mechanical, including photocopy, recording, scanning, or any information storage and retrieval systems now known or to be invented without prior express written permission of the author. SAct = String.Customizing macOS Mojave Fantastic Tricks, Tweaks, Hacks, Secret Commands, & Hidden FeaturesĬopyright © 2019 Tom Magrini Cover photo: Dene’ Miles / All rights reserved. String sPred = String.format("Predicted mouse location : %, d, %, d", x, y), YAct = (int) MouseInfo.getPointerInfo().getLocation().getY() XAct = (int) MouseInfo.getPointerInfo().getLocation().getX()
MOJAVE BETTERSNAPTOOL CODE
I tested this with the following code (note a few modifications, as the OP code had some "bugs"): import This way, the gradle daemon (a java process) will be responsible for running the application and proper permissions will be detected by macOS. If you're like me, you use gradle anyway for java projects in IntelliJ, and all you have to do is remember to run your project from the command line before running it from IntelliJ. This process is using java and java has permission to move the mouse cursor in macOS system preferences. What happens: IntelliJ, in step 6, uses the already running gradle daemon process to execute your application.

You can give IntelliJ all the permissions you want, but java will never be able to move the cursor when the permissions are given to IntelliJ. It seems macOS incorrectly detects the attempt to move the mouse as coming from IntelliJ, when in fact, it's coming from java. Now when I run my program, the robot command moves my mouse. After "checking" STS, I clicked the Lock icon at the bottom left again. I "checked" STS (you will "check" IntelliJ). I put in my password, and I am now allowed to "check" STS.
MOJAVE BETTERSNAPTOOL PASSWORD
I clicked on the icon, and a prompt came up asking for my password (I have some level of sysadmin privileges). There's a Lock icon at the bottom left of the window. And, all of these are grayed out so that I can't change any of the checks. Both BetterSnapTool and Ke圜astr are checked.

I see STS listed along with BetterSnapTool and Ke圜astr. This lists all the programs that can "control your computer". In System Preferences (the "gear" icon), under Security & Privacy, click the Privacy tab toward the top, then choose Accessibility on the left. You (and I) have to tell MacOS that it's ok for our Java program to control the mouse. I tried to click the "allow" checkbox, but it wouldn't let me. It was asking me something about giving permission for my program to control the screen or system or something.

I noticed a warning or informational type of message from MacOS while I was running my code. I have a statement "robot.mouseMove(100, 100) " and the mouse doesn't move at all.
