1

I have been tasked with deploying several iMacs for public display.

They will need to have an application running at all times (Serato DJ) and upon idle they should display a looped video - using saveHollywood screensaver to loop the and play the multiple video files

I have been toying with applescript for this job - I would have script run on boot. I think it should look something like this

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

I have to quit the application because it wont allow the screensaver to kick in - much like vlc

I know this isnt a lot to go on.

Can someone please help point me in the right direction

Any assistance would be greatly appreciated

Daniel

1 Answers1

0

Well, I'm not sure if this question is still relevant to you, but if it is, this should work:

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
Active Citizen
  • 119
  • 3
  • 12