hide message box

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
slindstrom
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 29
Joined: Mon Apr 09, 2012 8:53 pm

hide message box

Post by slindstrom » Wed May 04, 2022 9:12 pm

This is a basic question. Asking here anyway as I'm not a total newbie. I have a number of stacks/scripts for daily work use we generally run in the IDE, not as standalones, for a few reasons including frequent updating of the tools. Anyway, many scripts we run regularly finish leaving the message box open, perhaps even opening the message box at the end, even if the last command is hide message box. I've pored through these scripts looking for a possible cause with no success.

Possibly related: For many years I've noticed that command-M usually does not open the message box; need to select that option under the Tools menu instead.

Current configuration LC 9.6.5 running on OS X 11.6.1 though both these glitches date from earlier LC and OS versions. Any suggestions?

Thanks in advance,
Sieg

RogGuay
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 114
Joined: Fri Apr 28, 2006 12:10 am
Location: Seattle

Re: hide message box

Post by RogGuay » Thu May 05, 2022 6:07 am

Command-m should toggle the message box. Not sure why it's not working for you. Are you on a Mac

Roger

stam
Posts: 2682
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: hide message box

Post by stam » Thu May 05, 2022 7:01 am

Yep cmd-m should toggle the message box.

Very rarely I’ve had the message box misbehave (eg loosing all its buttons and only able to show the single line box). When this issue has persisted through IDE restart, I found that deleting the preferences file has fixed this for me.

To locate the pref file in the Finder just type

Code: Select all

put the filename of stack "revpreferences"
Shut down the IDE and delete this in Finder, and the IDE will create a fresh pref file on restart (obviously preferences like SE font will be reset).

Perhaps give that a try?

HTH
Stam
Last edited by stam on Thu May 05, 2022 9:27 am, edited 1 time in total.

livecodeali
Livecode Staff Member
Livecode Staff Member
Posts: 192
Joined: Thu Apr 18, 2013 2:48 pm

Re: hide message box

Post by livecodeali » Thu May 05, 2022 9:06 am

Usually if the message box opens unexpectedly it's because of a 'rogue put statement', that is a `put` statement with no `into`. In the bottom left of the message box there is a little 'target' symbol. If you click that it should take you to the line of script with the rogue put on it (assuming that's the cause in this case)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9381
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: hide message box

Post by richmond62 » Thu May 05, 2022 11:22 am

Usually if the message box opens unexpectedly it's because of a 'rogue put statement'
Thank you very much for that very useful bit of information, as, when I am working on my
Devawriter Pro source stack the message box opens every time I move to a different card,
and, at least if the stack does not contain rogue put statements in every
card script the whole thing was programmed by a rogue; so, guess how that rogue's going to
spend the better part of his weekend. 8)

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4000
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: hide message box

Post by bn » Thu May 05, 2022 1:05 pm

richmond62 wrote:
Thu May 05, 2022 11:22 am
Usually if the message box opens unexpectedly it's because of a 'rogue put statement'
my Devawriter Pro source stack the message box opens every time I move to a different card,
Richmond

Mark Wieder wrote a plug-in "Refactor" that has among many option also the option "Find Orphan Code"
Once the plug-in is installed it adds "Refactoring" to the Edit Menu (at the bottom) and also to a right-click in the Script Editor

That will find "put" that is directed to the message box, i.e. without any destination.
https://github.com/mwieder/revRefactor/ ... ter/Plugin

See also his announcement here in the Forum
https://forums.livecode.com/viewtopic.php?f=4&t=32364

I find Refactor very useful
Kind regards
Bernd

stam
Posts: 2682
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: hide message box

Post by stam » Thu May 05, 2022 1:12 pm

That's incredibly helpful, thank you for sharing Bernd!

stam
Posts: 2682
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: hide message box

Post by stam » Thu May 05, 2022 3:13 pm

bn wrote:
Thu May 05, 2022 1:05 pm
I find Refactor very useful
took me a few minutes to realise that the new refactor menu is only available in the edit menu of the script editor :oops: :oops:
looks very useful... a delayed thank you to Mark Wieder for providing this...

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9381
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: hide message box

Post by richmond62 » Fri May 06, 2022 12:30 pm

Well, would you believe it? Of course you would:

I found 74 occurrences of the following code in my Devawriter Pro stack:

Code: Select all

put (item 4 of line 1 of the screenrects) into HITE
   put WIDD
How silly can one get?

Anyway, all those occurrences replaced with:

Code: Select all

put (item 4 of line 1 of the screenrects) into HITE
mind-blowing quickly with the Find & Replace thing:

[OK, OK: 30 seconds: but quickly enough as far as I am concerned. Sure beats the crap out
of having to hunt out all those occurrences and then remove them manually.]
-
SShot 2022-05-06 at 14.28.13.png
While, from the point of view of end-users of the standalone it won't make any difference at all,
it does give me a warm fuzzy. 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9381
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: hide message box

Post by richmond62 » Fri May 06, 2022 12:41 pm

SShot 2022-05-06 at 14.40.27.png
-
That's a counter-intuitive name for the stack.
-
Aaaaaah: that feels much nicer:
-
SShot 2022-05-06 at 14.53.07.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9381
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: hide message box

Post by richmond62 » Fri May 06, 2022 7:00 pm

Come to think of things the Find & Replace (revSearch) stack is a very useful tool which those
silly little text fields top-and-bottom don't do justice to.
-
SShot 2022-05-06 at 23.58.10.png
-
Luckily hacks stick. 8)
Attachments
revSearch.livecode.zip
Stack.
(39.66 KiB) Downloaded 74 times

slindstrom
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 29
Joined: Mon Apr 09, 2012 8:53 pm

Re: hide message box

Post by slindstrom » Tue May 10, 2022 2:36 am

Yes, I'm on a Mac. The frequent failure of Command-m isn't such a big deal as there's always the item for toggling the message box under the Tools menu. Still, it's irritating.

I'm more bothered by the message box sitting open after a script has run.

I know not to leave "empty" put statements lying around though sometimes it happens after I've been testing a script and forget to delete those statements. I'd swear that for some of the scripts that end with the message box open I have searched assiduously for stray put statements and found none. I just repeated that for one such script.

I just now wondered if "hide message box" is functionally synonymous with toggle message box, and thus when I put "hide message box" in the script it opens the message box if it's not already open. Doesn't seem to be the case.

Thanks, all, for suggestions. I need to take notice of which scripts were in play the next time this occurs and keep all your suggestions in mind.

Sieg
RogGuay wrote:
Thu May 05, 2022 6:07 am
Command-m should toggle the message box. Not sure why it's not working for you. Are you on a Mac

Roger

stam
Posts: 2682
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: hide message box

Post by stam » Tue May 10, 2022 3:24 am

slindstrom wrote:
Tue May 10, 2022 2:36 am
The frequent failure of Command-m isn't such a big deal as there's always the item for toggling the message box under the Tools menu. Still, it's irritating.
The point is that cmd-m does not 'fail frequently' for most users. If this is happening a lot for you, i'd still suggest deleting he preferences file (this has sorted out all sorts of weird behaviour for me in the past). It does no harm and it may fix this issue for you.

slindstrom wrote:
Tue May 10, 2022 2:36 am
I'm more bothered by the message box sitting open after a script has run.
If the msgBox is popping up after running scripts there is no more likely explanation than a stray 'put' statement somewhere. Keep in mind this may for example be inside a behaviour script, and it's bitten me previously in a behaviour script of a control inside a datagrid for example, where it can be hard to locate.
The (free) Refactor plugin is probably the easiest way to locate these...

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”