shell command problem
Thomas McGrath III
3mcgrath at comcast.net
Tue May 29 10:40:21 EDT 2007
Can someone guide me in the correct use of the shell command on OSX.
I have an app called "iRed" which comes with a command line
application that I copied to the bin folder on my machine and from a
terminal window I can execute the following "ired -send "Robosapien
V2" "D" which works great. iRed is a program that can send IR codes
via a USB device called "irTrans" to my Robosapien V2 robot.
Everything works fine from within iRed controlling the robot.
Everything works fine from the terminal window.
Everything also works fine using an applescript:
try
tell application "iRed" to send ir Code "D" of RC "Robosapien V2"
on error
beep
end try
& Everything also works storing the applescript in a custom prop in
REV and then DOing the applescript.
The only thing I can't seem to figure out is how to run a command
line directly from within REV. The docs say if I am having trouble to
try the command line directly in a terminal window and it does indeed
work fine.
----
I have tried to set the shellcommand to "/bin/ired" with no result.
This is my script:
ON mouseUp
put field "myControl2" into tControl
IF tControl is not "" THEN
put the shellcommand into tShellPath
set the shellcommand to "/bin/ired"
shell (field "myControl2")
-- put quote & "ired - send " & quote & "Robosapien V2" &
quote & " " & Quote & "D" & Quote into tred
-- shell (tred)
set the shellcommand to tShellPath
ELSE
revspeak "OH OH"
END IF
END mouseUp
This is the error I keep getting:
Tue, 29 May 2007 10:37:43 -0400
Chunk: can't set property
Object: button id 1043 of card id 1002 of stack "/Applications/iRed/
Robosapien.rev"
location: Line 943 Char 24
Object: does not have this property
Object: button id 1043 of card id 1002 of stack "/Applications/iRed/
Robosapien.rev"
location: Line 943 Char 13
put: error in expression
Object: button id 1043 of card id 1002 of stack "/Applications/iRed/
Robosapien.rev"
location: Line 943 Char 1
Processing: mouseUp
Chunk: can't set property
Object: button id 1043 of card id 1002 of stack "/Applications/iRed/
Robosapien.rev"
location: Line 943 Char 24
Object: does not have this property
Object: button id 1043 of card id 1002 of stack "/Applications/iRed/
Robosapien.rev"
location: Line 943 Char 13
put: error in expression
Object: button id 1043 of card id 1002 of stack "/Applications/iRed/
Robosapien.rev"
location: Line 943 Char 1
More information about the use-livecode
mailing list