Page 1 of 2
Messagemessages
Posted: Sat Jan 18, 2020 5:41 pm
by dunbarx
This, or whatever its true name is, a close relative of the executionContexts, exists somewhere, though not documented. Richard Gaskin turned me on to it many years ago. There is a thread in the "Experienced..." pane where this may come in handy. Anyone remember what I am talking about?
Craig
Re: Messagemessages
Posted: Sat Jan 18, 2020 6:19 pm
by FourthWorld
I can recall many discussions about that property, but not that one specifically.
Do you have a question about messageMessages?
Re: Messagemessages
Posted: Sat Jan 18, 2020 8:43 pm
by dunbarx
Ah. Great.
Is there anything published about it? Syntax?
Craig
Re: Messagemessages
Posted: Sun Jan 19, 2020 3:50 pm
by mrcoollion
Re: Messagemessages
Posted: Sun Jan 19, 2020 3:58 pm
by FourthWorld
It's not documented by the core team because it was implemented as an ad hoc solution and is subject to change. So use it at your own risk, with the knowledge that any code dependent on it may need to be rewritten in the future.
For a description of what it is and how to use it, see this post to the use-LiveCode list:
http://runtime-revolution.278305.n4.nab ... 93216.html
To see a practical example in action see my tool 4W Flight Recorder, available in Stacks section of LiveNet - in the IDE choose Development -> Plugins -> GoLiveNet.
4W Flight Recorder is like the IDE's Message Watcher, but more flexible and with a more useful layout that indents to show the calling chain, and also provided an approximation of time spent in each handler in the chain. It also includes a set of filters which omit ranges of messages to make the output more useful by eliminating the reams of noise that can flood the list with things like IDE messages, mouseMove messages, and more, all customizable.
Re: Messagemessages
Posted: Sun Jan 19, 2020 8:17 pm
by dunbarx
Paul.
I understand the executionContexts. I offered it as a solution in another thread.
viewtopic.php?f=8&t=33551
It is the undocumented "messageMessages" that I am asking about.
Craig
Re: Messagemessages
Posted: Mon Jan 20, 2020 2:33 am
by dunbarx
Richard.
I first tried to find this in the forums, but must have misspelled my query, because I got nothing. Trying again:
viewtopic.php?f=6&t=4673&p=20882&hilit= ... ges#p20678
It was you that pointed the way.
I will play with this again when I get back to my office. It may have some use with that thread in the "experienced" pane that the executionContexts seems to have solved.
thanks again.
Craig
Re: Messagemessages
Posted: Mon Jan 20, 2020 7:44 am
by mrcoollion
dunbarx wrote: ↑Sun Jan 19, 2020 8:17 pm
Paul.
I understand the exectionContexts. I offered it as a solution in another thread.
viewtopic.php?f=8&t=33551
It is the undocumented "messageMessages" that I am asking about.
Craig
I should have known.

Re: Messagemessages
Posted: Mon Jan 20, 2020 2:55 pm
by dunbarx
Richard.
This is all academic, but I cannot get anything out of the "messageMessages". I set the "messageMessages" to "true" In a new stack with a couple of cards. I have this in the stack script:
Code: Select all
on openCard
answer random(99)
end openCard
on messageHandled
breakpoint
end messageHandled
Navigating produces random numbers, but the breakpoint never fires.
Craig
Re: Messagemessages
Posted: Mon Jan 20, 2020 5:06 pm
by FourthWorld
I dunno what's up. It works in 4W Flight Recorder.
You might want to try the log command instead of breakpoint, because messageHandled will be sent for EVERY message handled, including those the IDE uses, so if you successfully get into the debugger you may never escape.
Re: Messagemessages
Posted: Mon Jan 20, 2020 6:28 pm
by mwieder
Craig-
put the messageHandled handler in a frontscript to see it in action. I don't think it will get to any of the stack scripts.
Re: Messagemessages
Posted: Mon Jan 20, 2020 7:10 pm
by dunbarx
Mark.
Yep, that worked. And as Richard warned, that sort of thing can get unruly.
Craig
Re: Messagemessages
Posted: Thu Jan 23, 2020 11:19 am
by mrcoollion
dunbarx wrote: ↑Mon Jan 20, 2020 7:10 pm
Mark.
Yep, that worked. And as Richard warned, that sort of thing can get unruly.
Craig
Hi Craig,
I am trying to learn from this thread about 'messageMessages' and 'frontscript'. So could you attach a small sample script for me to analyse?
I cannot seem to get things working in such a way that I understand what is happening.
regards,
Paul
Re: Messagemessages
Posted: Thu Jan 23, 2020 4:07 pm
by FourthWorld
Here's a fully working example, and one of the few practical uses of messageMessages:
viewtopic.php?f=9&t=33553&sid=f10f638f8 ... d3#p187061
Re: Messagemessages
Posted: Thu Sep 17, 2020 1:27 pm
by marksmithhfx
FourthWorld wrote: ↑Sun Jan 19, 2020 3:58 pm
4W Flight Recorder is like the IDE's Message Watcher, but more flexible and with a more useful layout that indents to show the calling chain, and also provided an approximation of time spent in each handler in the chain. It also includes a set of filters which omit ranges of messages to make the output more useful by eliminating the reams of noise that can flood the list with things like IDE messages, mouseMove messages, and more, all customizable.
Is there anything avail that could be called from inside an app (I'd like to run something inside an iOS app for example) that could be turned on/off under script control. Something along the lines of:
Code: Select all
on messagesStartRecording
open file (specialFolderPath("documents") & “/messages.txt")
end messagesStartRecording
Code: Select all
on messagesStopRecording
close file (specialFolderPath("documents") & “/messages.txt")
end messagesStopRecording
In particular I am looking to find out what kind of messages are sent to a datagrid when you swipe across a control and "swipes" are enabled. I am just starting down this path and the documentation I've found is not overly helpful, but also in general having the ability to capture which messages are sent in specific situations would be useful.
Maybe there is something like this already and I don't know about it?
Thanks
Mark