Running A Script From The Main Menu - Roku HD1000 Manual

External control protocol
Hide thumbs Also See for HD1000:
Table of Contents

Advertisement

PATH=$PATH:/usr/local/bin
# Launch the Photo app in "playlist" mode (which opens
# no windows and just waits for ECP commands).
# Be sure to launch in background (with &), or the
# script will not continue past this line!
photo –p &
# Wait a bit to make sure Photo has launched.
sleep 2
# Set the image directory, making sure it's valid.
ecp photoApp IMAGEDIR "/tmp/Volumes/CompactFlash" | \
grep 'photoApp: ok'
# This line tests whether grep returned 0 (meaning
# that the reply string contained "photoApp: ok")
if [ $? -eq 0 ]
then
ecp photoApp SLIDESHOW "/tmp/Volumes/CompactFlash"
else
echo "failed to set directory"
ecp photoApp QUIT
fi
Consult a reference on Linux shell scripting for details on the syntax of shell scripts.

Running a script from the Main Menu

It's easy to make a script you've written appear in the main menu. Just name your script file
with a ".roku" extension, like "MySlideshow.roku". Put the file onto a flash card or in the shared
folder on your computer that you connect to from your HD1000. You will see a button in the
"Roku Applications" section of the Main Menu corresponding to your new script.
Note: The file must be marked executable. On most flash cards and file servers, this is
automatic. Consult your favorite Linux reference for details if you're not certain.
Roku External Control Protocol for the HD1000
© 2003 Roku, LLC
4

Advertisement

Table of Contents
loading

Table of Contents