I was wondering if there was a way to make an open process interactive, or better said be able to enter more input to that command line or shell before the close process, something like a rudimentary expect.
For instance, say that someone wants to launch a telnet command through a revolution interface so that their username and password would have to be entered after the launch of the command.
I guess there would be a button with more or less this code but i have no clue how to implement the "put this in that shell":
Code: Select all
on mouseUp
open process "telnet "&server_ip
read from process "telnet "&server_ip for 10 in 10 seconds
put it into some_variable
if matchtext(some_variable,".*username.*") then ???????
if matchtext(some_variable,".*password.*") then ???????
close process "telnet "&server_ip
end mouseUp