有什么办法可以让我的脚本自动关闭?注意:如果你强行退出,屏保会留在桌面上,所以不是因为它是在应用程序中运行的。
tell application "System Events"
tell screen saver preferences
if running then
do shell script "killall ScreenSaverEngine"
else
do shell script "//System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background"
end if
end tell
end tell