on idle doesn't work in task bar
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
on idle doesn't work in task bar
Hi: I have a stack script that uses "on idle". It looks for a certain field to be NOT EMPTY, then does some things. It works, but when the app is reduced down into the Mac OS task bar, it doesn't work. I believe the "on idle" works, but field contents aren't refreshed until the app becomes live. I would like this to run in the background.
Re: on idle doesn't work in task bar
adventuresofgreg,
Idle is sent to the current stack and only if this stack is the front window. This was done on purpose, to avoid high processor loads.
Instead of idle, you can use the send command:
This script sends the foo message 5 times per second. I would recommend sending messages as infrequently as possible.
Best,
Mark
Idle is sent to the current stack and only if this stack is the front window. This was done on purpose, to avoid high processor loads.
Instead of idle, you can use the send command:
Code: Select all
on foo
-- do something first
send "foo" to me in 200 millisecs
end foo
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
Re: on idle doesn't work in task bar
Hi Mark:
I put this into the stack script - it doesn't work, so I'm probably not doing it right:
on foo
global finallocation
if finallocation is not empty then
click at the loc of card button "senditnow"
end if
send "foo" to me in 200 millisecs
end foo
I put this into the stack script - it doesn't work, so I'm probably not doing it right:
on foo
global finallocation
if finallocation is not empty then
click at the loc of card button "senditnow"
end if
send "foo" to me in 200 millisecs
end foo
Mark wrote:adventuresofgreg,
Idle is sent to the current stack and only if this stack is the front window. This was done on purpose, to avoid high processor loads.
Instead of idle, you can use the send command:
This script sends the foo message 5 times per second. I would recommend sending messages as infrequently as possible.Code: Select all
on foo -- do something first send "foo" to me in 200 millisecs end foo
Best,
Mark
Re: on idle doesn't work in task bar
adventuresofgreg ,
Click at loc may not work either, for various reasons. Use
instead.
What else did you do, besides adding the script? You'll have to get the foo cycle going, somehow.
Best,
Mark
Click at loc may not work either, for various reasons. Use
Code: Select all
send "mouseUp" to button "senditnow"
What else did you do, besides adding the script? You'll have to get the foo cycle going, somehow.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
Re: on idle doesn't work in task bar
Hey Mark - OK I gotcha. I added "on openstack" "send "foo" to me" and that got the whole "foo" fun started. Also sending mouseup to the button worked. I can reduce the app to the task bar and it works, except when the condition is met and it does it's thing, the whole app pops up from the task bar. I would like the app to just continue to work while hiding in the task bar.
Mark wrote:adventuresofgreg ,
Click at loc may not work either, for various reasons. Use
instead.Code: Select all
send "mouseUp" to button "senditnow"
What else did you do, besides adding the script? You'll have to get the foo cycle going, somehow.
Best,
Mark
Re: on idle doesn't work in task bar
adventuresofgreg ,
Do you have a go or show command somewhere?
Kind regards,
Mark
Do you have a go or show command somewhere?
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
Re: on idle doesn't work in task bar
Ya I have a go stack. I'm just in the process of amalagmatic both stacks into one. I'm sure that's why it's doing it.
Mark wrote:adventuresofgreg ,
Do you have a go or show command somewhere?
Kind regards,
Mark
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
Re: on idle doesn't work in task bar
More problems... I resolved the issues I had with the stack running properly in the background - it works ok now. Except, an old problem has resurfaced and now I don't know how to solve it. I really appreciate your help.
I have combined 2 demo stacks together: SMTP_library_demo.rev and POP_library_demo.rev
http://www.troz.net/rev/index.irev?cate ... ary#stacks
What I need to do is have this email app run in the background checking an email account for new mail every minute or so. Then, when it finds new mail, it opens it, parses the msg and re-formats it, sticks it into a field and is bounced to another email address. (It's a GPS location from a tracking device that is reformated and sent to an Iridium satellite phone as a text message).
Everything works fine - except... that now that I have combined the two stacks together in order to run it properly in the background, the 'read emails' script stops as soon as the "send email" script starts, and the last part of the "read email" script which is a function to DELETE the email, doesn't get activated. So - the same email continually is read and bounced every minute.
Do you have any ideas as to how I can allow this script to complete itself BEFORE activating the STMP send mail script?
Thanks man
Greg
I have combined 2 demo stacks together: SMTP_library_demo.rev and POP_library_demo.rev
http://www.troz.net/rev/index.irev?cate ... ary#stacks
What I need to do is have this email app run in the background checking an email account for new mail every minute or so. Then, when it finds new mail, it opens it, parses the msg and re-formats it, sticks it into a field and is bounced to another email address. (It's a GPS location from a tracking device that is reformated and sent to an Iridium satellite phone as a text message).
Everything works fine - except... that now that I have combined the two stacks together in order to run it properly in the background, the 'read emails' script stops as soon as the "send email" script starts, and the last part of the "read email" script which is a function to DELETE the email, doesn't get activated. So - the same email continually is read and bounced every minute.
Do you have any ideas as to how I can allow this script to complete itself BEFORE activating the STMP send mail script?
Thanks man
Greg
adventuresofgreg wrote:Ya I have a go stack. I'm just in the process of amalagmatic both stacks into one. I'm sure that's why it's doing it.
Mark wrote:adventuresofgreg ,
Do you have a go or show command somewhere?
Kind regards,
Mark