1

我的任务是部署几台 iMac 以供公众展示。

他们需要始终运行一个应用程序(Serato DJ),并且在空闲时他们应该显示一个循环播放的视频 - 使用 saveHollywood 屏幕保护程序循环播放多个视频文件

我一直在为这项工作玩弄applescript - 我会在启动时运行脚本。我认为它应该看起来像这样

苹果脚本 -

tell application "Serato DJ"to activate

on idle
tell application "Serato DJ" to quit
tell application "System Events" to start current screen saver
end idle

我必须退出应用程序,因为它不允许屏幕保护程序启动 - 就像 vlc

我知道这不是很多事情要做。

有人可以帮我指出正确的方向吗

任何帮助将不胜感激

丹尼尔

4

1 回答 1

0

好吧,我不确定这个问题是否仍然与您相关,但如果是,这应该有效:

repeat
    --This variable is how long the script waits before it turns the screen saver on 
    set timeToSleep to 300
    --
    set idleTime to do shell script "ioreg -c IOHIDSystem | awk '/HIDIdleTime/ {print $NF/1000000000; exit}'"
    considering numeric strings
        if idleTime is greater than timeToSleep then
            tell application "Serato DJ" to quit
            tell application "System Events" to start current screen saver
        end if
        if idleTime is less than timeToSleep then
            if application "Serato DJ" is not running then
                try
                    do shell script "killall ScreenSaverEngine"
                    tell application "Serato DJ" to activate
                end try
            end if
        end if
    end considering
    delay 1
end repeat
于 2015-06-20T19:21:04.647 回答