please use this thread for comments & questions & suggestions & problems for SATI
Karl
self.myLog(255, u"EXECCMD Line '%s' has error='%s'" % (sys.exc_traceback.tb_lineno, e) )
set cmd to "\"setVariable;:;:;myVariableName;:;:;value\" "
autolog wrote:How do I insert an applescript variable as a replacement for value in the line:
- Code: Select all
set cmd to "\"setVariable;:;:;myVariableName;:;:;value\" "
set cmd to "\"setVariable;:;:;myVariableName;:;:;" & value & "\" "
How do I insert an applescript variable as a replacement for value in the line:
set command to "setVariable"
set variableName to "window1"
set windowValue to "55"
set seper to ";:;:;"
set cmd to "\""& command & seper & variableName & seper & windowValue &"\" " -- the spaces before and after & are ignored
--is equivalent to
set cmd to "\"setVariable;:;:;window1;:;:;55\" "
kw123 wrote:Yes it does - thanks... hope that helps
and it doesTell Indigo turn on study lamp
I have now got SATI working in conjunction with my Applescript to send SIRI commands to Indigo
kw123 wrote:Jon,I have now got SATI working in conjunction with my Applescript to send SIRI commands to Indigo
could you post the code you are using?
Karl
(* File: Indigio Remote Control.applescript *)
using terms from application "Messages"
-- handler to respond to all incoming messages.
on runiTunesRemoteControl(theMessage, theBuddy)
with timeout of 30 seconds
set theResponse to "STARTING UP"
if theBuddy is not equal to "TESTBUDDY" then
set theBuddy to theBuddy's handle
(* change the below email address to those allowed and decide response to those not allowed *)
set Allowed to 0
if theBuddy is equal to "<MOBILE 1 OR EMAIL 1>" then
set Allowed to 1
end if
if theBuddy is equal to "<MOBILE 2 OR EMAIL 2 (ETC)>" then
set Allowed to 1
end if
if Allowed is equal to 0 then
set theResponse to "ERROR: Access to Indigo not allowed for sender '" & theBuddy & "'"
return theResponse
end if
end if
try
set myuserid to "<USERID>"
set pathX to "/users/" & myuserid & "/Documents/SATI/"
set channel to 1
set cmd to "\"setVariable;:;:;iMessage;:;:;" & theMessage & "\" "
set cmd to "echo " & cmd
do shell script cmd & " > " & pathX & "fromAS-" & channel as string
set theResponse to "ACTIONED: " & theMessage
on error errorMessage
set theResponse to "ERROR: " & errorMessage
end try
end timeout
return theResponse
end runiTunesRemoteControl
-- When first message is received, accept the invitation and send a greeting message from iTunes Remote Control.
on received text invitation theMessage from theBuddy for theChat
accept theChat
send "Welcome to Indigo Remote Control." to theChat
set theResponse to runiTunesRemoteControl(theMessage, theBuddy)
send theResponse to theChat
end received text invitation
-- On subsequent messages, pass the message directly to iTunes Remote Control.
on message received theMessage from theBuddy for theChat
-- run the iTunesRemoteControl parser.
set theResponse to runiTunesRemoteControl(theMessage, theBuddy)
-- send back the response.
send theResponse to theChat
end message received
-- Sample, so you can test run this through Script Editor.
display dialog "Send a command to Indigo Remote Control:" default answer "status"
set theMessage to the text returned of the result
set theTestBuddy to "TESTBUDDY"
set theResponse to runiTunesRemoteControl(theMessage, theTestBuddy)
(*display dialog theResponse
*)
# The following are unused but need to be defined to avoid an error
on received audio invitation theText from theBuddy for theChat
end received audio invitation
on received video invitation theText from theBuddy for theChat
end received video invitation
on received remote screen sharing invitation from theBuddy for theChat
end received remote screen sharing invitation
on received local screen sharing invitation from theBuddy for theChat
end received local screen sharing invitation
on received file transfer invitation theFileTransfer
end received file transfer invitation
on message sent theMessage for theChat
end message sent
on addressed message received theMessage from theBuddy for theChat
-- run the iTunesRemoteControl parser.
set theResponse to runiTunesRemoteControl(theMessage, theBuddy)
-- send back the response.
send theResponse to theChat
end addressed message received
on av chat started
end av chat started
on av chat ended
end av chat ended
(* HANDLERS *)
on login finished for theService
end login finished
on logout finished for theService
end logout finished
on buddy became available theBuddy
end buddy became available
on buddy became unavailable theBuddy
end buddy became unavailable
on buddy authorization requested theRequest
end buddy authorization requested
on chat room message received theMessage from theBuddy for theChat
-- run the iTunesRemoteControl parser.
set theResponse to runiTunesRemoteControl(theMessage, theBuddy)
-- send back the response.
send theResponse to theChat
end chat room message received
on addressed chat room message received theMessage from theBuddy for theChat
-- run the iTunesRemoteControl parser.
set theResponse to runiTunesRemoteControl(theMessage, theBuddy)
-- send back the response.
send theResponse to theChat
end addressed chat room message received
on active chat message received theMessage from theBuddy for theChat
-- run the iTunesRemoteControl parser.
set theResponse to runiTunesRemoteControl(theMessage, theBuddy)
-- send back the response.
send theResponse to theChat
end active chat message received
on completed file transfer
end completed file transfer
end using terms from
to turn on the lamp orTell indigo turn study lamp on
(to toggle it).Tell indigo study lamp
Users browsing this forum: No registered users and 1 guest