Home
Posted By: Virtual1 playing a movie via automator - 04/09/15 01:14 PM
I would like to set up a kiosk that when powered on auto-logs-in and loops a movie.

Initially I thought I'd just put the movie in that user's login items. That works, but (A) it does not full screen, (B) loop is disabled, and (C) it does not play automatically.

So I turned to automator. I was pleasantly surprised to see quicktime specifically supported on the left. I added a Get Movies and added the one MP4. I added Play Movies and selected fullscreen and loop. Saved.

When I quit automator and ran it, it did NOTHING. I went back to automator and tried to debug it. It required me to additionally do a Get File because automator can't pass the movie over with the Get Movie option. So I did that and selected the MP4. When I play, it STILL does nothing. (other than run through the script and appear to immediately complete successfully)

I called applecare and was shocked to find out they don't support automator. (I realized they don't support terminal, but this is the first time I've been turned down for anything else reasonable) All they could do is advise me to get online and ask for help. (I'd already spent time googling around for answers)

I would just use an osascript -e if I knew the exact syntax to get it to load the movie, full screen, loop, and play, but I didn't find that after a short search. I'll be searching more later today though, maybe I'll get lucky.

Anyone happen to know how to get automator to play a movie? or know the magic combination of osascript commands?
Posted By: Virtual1 Re: playing a movie via automator - 04/09/15 03:30 PM
#!/bin/bash

sleep 5

f=$(ls ~/Desktop/movie)

while true ; do

open /Applications/Quicktime\ Player.app
sleep 1
osascript -e "tell application \"Quicktime Player\" to open \"Macintosh HD:Users:$USER:Desktop:movie:$f\"" > /dev/null
while true ; do
n=$(osascript -e 'tell application "Quicktime Player" to get name of document 1')
if [ "$n" == "$f" ] ; then
break
fi
sleep 1
done

while true ; do
osascript -e "set Volume 5"
osascript -e 'tell application "Quicktime Player" to set looping of document 1 to true '
osascript -e 'tell application "Quicktime Player" to set presenting of document 1 to true '
osascript -e 'tell application "Quicktime Player" to set audio volume of document 1 to 1 '
osascript -e 'tell application "Quicktime Player" to set muted of document 1 to false'
osascript -e 'tell application "Quicktime Player" to play document 1 '
rc=$?
if [ $rc != 0 ] ; then
break
fi
sleep 1
done

killall "QuickTime Player"

done
© FineTunedMac