开发者

Playing music on a Mac in lock screen and display off

开发者 https://www.devze.com 2023-04-12 02:18 出处:网络
I have an app with a behavior that I want to copy. The app can play music in the lock screen state. The app can also turn off the screen at this state. I\'m not too sure if the app is placing the Mac

I have an app with a behavior that I want to copy. The app can play music in the lock screen state. The app can also turn off the screen at this state. I'm not too sure if the app is placing the Mac in sleep mode but the white indicator light on the front of the Mac book is on but is not pulsing while the display is off.

I know how to play music and place the mac in the lock screen state using apple script. What I don't know how to do is turn off the display and have the indicator light turned on. This behavior is similar to when the Mac is in sleep mode. Any ideas as to how this can be done programmatically using objective-c and/or apple script?

I cannot use anything that is not documented by Apple. I am running the latest version of OSX Li开发者_Go百科on.


If you hold down the command, shift and eject buttons at the same time, the screen goes dark instantly. I just confirmed this in 10.7.1.

As for Applescripting Display Sleep, it's not trivial. I did find a probable solution in this thread:

http://macscripter.net/viewtopic.php?pid=135732#p135732

Give it a try and see if it accomplishes what you are looking for.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号