Page 1 of 1

Update fields without user interaction

Posted: Tue Sep 08, 2015 4:55 pm
by kolia
Hello,
I want to update some data fields without user interaction, which means there is a need for some kind of process running aside being able to grab data and update fields or any other objects. Is there a way to do that?
Thank you

Re: Update fields without user interaction

Posted: Tue Sep 08, 2015 5:05 pm
by dunbarx
Hi.

It may matter greatly how this new data is acquired. But in the meantime, on a new card, make a field and a button. In the button script:

Code: Select all

on mouseUp
   runFieldUpdater
end mouseUp

on runFieldUpdater
   if the optionkey is down then exit runFieldUpdater
   put the mouseLoc into fld 1 --this could be anything at all
   send "runFieldUpdater" to me in 30
end runFieldUpdater
If you click the button and move the mouse around, you will see the mouseLoc appear in the field every half second. You can escape by holding the optionKey down for just a little while. But is this what you meant by:
update some data fields without user interaction,
Anyway, the process runs in the "background" and is not blocking.

Craig Newman

Re: Update fields without user interaction

Posted: Tue Sep 08, 2015 5:08 pm
by kolia
Hi Craig,
Thanks for the code snippet. Yes you're right I should have said how data is acquired. In this case, data is acquired by executing a put URL and then parsing the XML response
Nicolas

Re: Update fields without user interaction

Posted: Tue Sep 08, 2015 7:07 pm
by dunbarx
OK.

So does the snippet I give you enough ammunition to proceed with your project?

Craig

Re: Update fields without user interaction

Posted: Tue Sep 08, 2015 7:21 pm
by kolia
So far yes. I'll write back if I face difficulties.
Thanks again
Nicolas