Page 1 of 1

read from process question

Posted: Mon Mar 19, 2007 1:00 pm
by BIX
what is wrong with this script? Why does rev freeze after it?

Code: Select all

on mouseUp
  open process "C:/someApp.exe"
  read from process "C:/someApp.exe" until end
  put it into field "someField"
end mouseUp

Posted: Mon Mar 19, 2007 3:26 pm
by Mark
Hi BIX,

You open the process, but you don't specify a read/write mode. The following might work:

open process "C:/someApp.exe" for read

Are you sure that the process quits automatically? I would expect a line

close process "someApp"

after the read command. Are you sure that the process actually returns data? If Revolution starts reading but doesn't find any data, it might wait for data and freeze meanwhile (but I haven't really tested this and I might be wrong).

What kind of programme are you using? Do you have any additional information about it? It might be the source of the problem.

Best,

Mark

Posted: Wed Mar 21, 2007 1:56 pm
by BIX
OK, i'll change the question. what sort of apps can be read with -read from process- command. that's the only thing i wanted to know, because i tried this command and it freezes every time.

Posted: Wed Mar 21, 2007 2:17 pm
by Mark
Hi Bix,

Probably, the best answer is: programmes of which you know that they have been designed to return data to the application calling them. Usually, these are command line utilities, or GUI applications that can also be used as command line utiities.

This doesn't mean that you can't start many applications as a process from within Revolution. You can open them, but you just can't read from them.

Best,

Mark