On 5 Dec 2007, at 12:18, Klaus Major wrote:
revCopyFile uses Applescrip which is blocking! At least in Rev, but
NOT when
using the same script with the AppleScriptEditor!? :-/
Using "shell" is also blocking!
This has come up a few times on the list, and basically revolves
around using a shell command that sends it's output to a text file
instead of back to Rev.
Rev carries on because as far as it's concerned the shell command has
finished, then you can do some kind of loop checking the output text
file, without blocking.
On 14 Aug 2006, at 09:48, Brian Yennie wrote:
You might try something like:
get shell("mylongcommand > output.txt &")
This should redirect the output to a file and return immediately.
It's not as clean as triggering a "done" message with new syntax
would be, but it may be workable. You might try searching the
archives - I seem to recall discussing this one many moons ago...
And:
On 12 Nov 2006, at 23:52, Sarah Reichelt wrote:
function checkPing pIP
put specialFolderPath("Desktop") & "/ping.txt" into tFileName
if there is a file tFileName then delete file tFileName
put "ping -c1 -n " & pIP into tShellCmd
put " > " & tFileName & " 2>&1 &" after tShellCmd
get shell(tShellCmd)
put 0 into timeCheck
repeat 50 times
add 1 to timeCheck
wait 1 tick with messages
if there is a file tFileName then
put URL ("file:" & tFileName) into tRes
if tRes is empty then next repeat -- file created but no
result yet
put wordOffset("loss", tRes) into tWord
if tWord = 0 then next repeat -- file created but result
not complete
-- if there is a file tFileName then delete file tFileName
put word tWord-2 of tRes into tPercent
if tPercent = "0%" then return true
else return false
end if
end repeat
if there is a file tFileName then delete file tFileName
return false
end checkPing
Ian
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution