| Sign In/My Account | View Cart |
| Article: |
Build an iTunes Remote Control | |
| Subject: | I wrote this, And it doesn't work. | |
| Date: | 2005-03-20 11:06:47 | |
| From: | ptwobrussell | |
|
Response to: I wrote this, And it doesn't work.
|
||
|
Ok. Your AppleScript appears to be good, and without trying to run it myself, your Perl script appears alright as well. If I had to guess, I might say that you haven't modified the daemon code since you neglected to mention that at all.
|
||
Showing messages 1 through 4 of 4.
I wrote this, And it doesn't work.sudo chmod 777 /private/tmp/iTunesRemoteControl in terminal. That will do the trick. I have also added some commands(change album), which anyone can do, copy and paste the info in any if the xxx.pl file's. #!/usr/bin/perl
system "echo 'XXXXX' > /tmp/iTunesRemoteControl";
system "chmod uga+rw /tmp/iTunesRemoteControl";
print "Content-type: text/vnd.wap.wml\n\n";
open MENU, "./menu" or die "'menu' not in current dir";
while (<MENU>) {print "$_";}
close MENU; #!/bin/bash
##########################################################
#Matthew Russell -25 Feb 05
#Usage: prompt$./iTunesRemoteControlDaemon.scr &
#
#This simply reads a file and executes an AppleScript that
#controls iTunes based on its content.
#
#kill the daemon with script killRemoteDaemon.scr
##########################################################
############
#User Prefs
############
scriptDir="/Library/WebServer/CGI-Executables"
remoteCommand="/tmp/iTunesRemoteControl"
delay="1.0"
#############
#begin script
#############
while [ 1 ]; do
status=`cat $remoteCommand`
case $status in
"getlyrics") osascript $scriptDir/GoogleLyricSearch.scpt;;
"nextalbum") osascript $scriptDir/PlayNextAlbum.scpt;;
"open") osascript $scriptDir/open.scpt;;
"RandomTrack") osascript $scriptDir/RandomTrack.scpt;;
"Rewind") osascript $scriptDir/Rewind.scpt;;
"FastForward") osascript $scriptDir/FastForward.scpt;;
"MuteUnMute") osascript $scriptDir/MuteUnMute.scpt;;
"PlayPause") osascript $scriptDir/PlayPause.scpt;;
"VolumeDown") osascript $scriptDir/VolumeDown.scpt;;
"VolumeUp") osascript $scriptDir/VolumeUp.scpt;;
esac
echo "" > $remoteCommand
sleep $delay
done
I wrote this, And it doesn't work.
tell application "Terminal"do shell script "sudo /Library/WebServer/CGI-Executables/iTunesRemoteControlDaemon.scr" password "xxxx" with administrator privileges
end tell
But again terminal locks.