I tried to set its global size using this code:
-(void)setOption {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSDictionary *olddict = [defaults persistentDomainForName:@"com.apple.universalaccess"];
NSMutableDictionary *newdict = [olddict mutableCopy];
[newdict setObject:@4.0 forKey:@"mouseDriverCursorSize"];
[defaults setPersistentDomain:newdict forName:@"com.apple.universalaccess"];
[defaults synchronize];
NSLog(@"Cursor size set to %@", newdict);
}
And I see in NSLog that it changed it, but I donβt know how to restart / reset the system cursor so that the cursor changes to the specified size.
Does anyone know a better way to programmatically resize it or how to restart the system cursor after changing the default?
EDIT (about duplication): My question is unique because I cannot use applescript to resolve this, as in the answer presented in another topic. This topic was also created in 2013 and seems outdated. Maybe since then the situation has changed a bit. In addition, Swift could be a viable solution to this problem. Who knows? All of these arguments make it clear that this is not a duplicate question.
source
share