I see a few things here and there about cancelling the message called when other actions will create an issue (such as changing cards), but I'm not having success in cancelling the pending message.
Here's what I have (in brief)
Code: Select all
global myPendingMessages
on openCard
checkOnlineMachines
end openCard
on checkOnlineMachines
put field APIToken on card "Settings" into apiToken
if (apiToken = "") or (apiToken is empty) then
...show some warning fields to tell the user to get an API Key
else
... do a bunch of stuff that works when on the card.
else
answer "Something weird happened here!"
end if
end if
put the label of button "UpdateTimeSel" of card "Settings" into updateTimeFrame
send checkOnlineMachines to me in (60 * updateTimeFrame) seconds
put "updated after" && updateTimeFrame after field "Logging"
end checkOnlineMachines
on closeCard
repeat for each line thisMessageID in myPendingMessages
cancel thisMessageID
end repeat
end closeCard