An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Previous Thread
Next Thread
Print Thread
playing a movie via automator
#33752 04/09/15 01:14 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
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?


I work for the Department of Redundancy Department
Re: playing a movie via automator
Virtual1 #33761 04/09/15 03:30 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
#!/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


I work for the Department of Redundancy Department

Moderated by  cyn, dianne 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.4.33 Page Time: 0.010s Queries: 18 (0.007s) Memory: 0.5725 MB (Peak: 0.6241 MB) Data Comp: Zlib Server Time: 2024-03-28 12:45:09 UTC
Valid HTML 5 and Valid CSS