Re: Detect when I start to work...
Re: Detect when I start to work...
- Subject: Re: Detect when I start to work...
- From: 2551phil <email@hidden>
- Date: Fri, 24 Mar 2017 16:41:49 +0700
You should be able to do this through ASObjC without needing KM.
Let me try that again….
//register for an observer NSNotificationCenter* center = [[NSWorkspace sharedWorkspace] notificationCenter];
NSDistributedNotificationCenter* distcenter =[NSDistributedNotificationCenter defaultCenter];
[center addObserver:observer selector:@selector(systemDidWake) name:NSWorkspaceDidWakeNotification object:nil];
[distcenter addObserver:observer selector:@selector(systemDidWake) name:@"com.apple.screensaver.didstop" object:nil];
[distcenter addObserver:observer selector:@selector(systemDidWake) name:@"com.apple.screenIsUnlocked" object:nil];
//do something on wake -(void) systemDidWake { NSLog(@“I just woke up!"); }
Best
Phil @sqwarq
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden