2016-03-10, 13:40
(2016-03-10, 12:12)bigbadrabbit Wrote:(2016-03-09, 22:00)KenV99 Wrote: %mt
This returns music|pvr|movie|episode|stream|unknown
So in your script when you process the command line arguments you would execute only if the argument is equal to movie or episode.
Thanks. I simply have zero experience with such arguments in scripts. All of my scripts are simple Applescripts which get called from within the bash via oascript:
Code:#!/bin/bash
/usr/bin/osascript <<-EOF
tell application "AirServer" to stop broadcast
do shell script "curl http://192.168.0.20/goform/formiPhoneAppDirect.xml?PSDYNVOL%20OFF"
tell application "iTunes"
pause
end tell
tell application "Hue Server" to run command "Wohnzimmer Off"
tell application "AirServer" to start broadcast
EOF
Could you please tell me WHERE i'd need to put in the proper argument to filter out movie or episode? Many thanks again!
Can't test it directly but google 'bash command line arguments' to read up ($1)
Code:
#!/bin/bash
if test -z "$1"
then
if ["$1" != "stream"] && ["$1" != "pvr"] && ["$1" != "music"]
then
/usr/bin/osascript <<-EOF
tell application "AirServer" to stop broadcast
do shell script "curl http://192.168.0.20/goform/formiPhoneAppDirect.xml?PSDYNVOL%20OFF"
tell application "iTunes"
pause
end tell
tell application "Hue Server" to run command "Wohnzimmer Off"
tell application "AirServer" to start broadcast
EOF
fi
fi
might work