button
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 35
- Joined: Sun Feb 02, 2014 12:20 am
button
How do I code a button so that after it is clicked once, it goes through the code embedded in that button...then it waits 5 seconds...then it goes through the code again without having to click the button again.
Re: button
Salaam Ferhan,
I think you need use a send message in time to do it
Have a look to "send" command in dictionary
Best regards
Jean-Marc
I think you need use a send message in time to do it
Have a look to "send" command in dictionary
Best regards
Jean-Marc
https://alternatic.ch
-
- Posts: 35
- Joined: Sun Feb 02, 2014 12:20 am
Re: button
Was salaamjmburnod wrote:Salaam Ferhan,
I think you need use a send message in time to do it
Have a look to "send" command in dictionary
Best regards
Jean-Marc
I tried using the send but it didnt seem to work...my code looks like this
this is button "Button"
on mouseUp
answer "hii"
send "mouseDown" to button "Button" in 5 seconds
end mouseUP
Re: button
Hi Ferhan,
What is the name of the command above?
What is the name of the command you wish to trigger after 5 seconds?
If you still need help just ask.
Simon
I'll quiz you on this one because finding things yourself is more fun.on mouseUp
answer "hii"
send "mouseDown" to button "Button" in 5 seconds
end mouseUP
What is the name of the command above?
What is the name of the command you wish to trigger after 5 seconds?
If you still need help just ask.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 35
- Joined: Sun Feb 02, 2014 12:20 am
Re: button
ohh i figured it out.....it should've been ....send "mouseUp" instead of send "mouseDown" =p , thanks.Simon wrote:Hi Ferhan,I'll quiz you on this one because finding things yourself is more fun.on mouseUp
answer "hii"
send "mouseDown" to button "Button" in 5 seconds
end mouseUP
What is the name of the command above?
What is the name of the command you wish to trigger after 5 seconds?
If you still need help just ask.
Simon
Re: button

To save your sanity you will want a way to break out of your loop so
Code: Select all
on mouseUp
answer "hii"
if the optionKey is up then --alt key on win
send "mouseUp" to me in 5 seconds --Note the "to me" as the command is in the button
end if
end mouseUp
Code: Select all
global gCancel
on mouseUp
beep
send "mouseUp" to me in 5 second
put the result into gCancel
end mouseUp
Code: Select all
global gCancel
on optionKeyDown
cancel gCancel
end optionKeyDown
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!