msg_stayontop not working in compiled version

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
RNIB
Macro Veteran
Posts: 198
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

msg_stayontop not working in compiled version

Post by RNIB » Fri Jun 05, 2009 1:35 pm

I guess I must be doing something stupid but I've no idea what.

This is the end of a macro I've written:

Code: Select all

<snip>
// Sets Narrator

SetFocus>Recording Management System - [View/Amend Title]
WaitWindowOpen>Recording Management System - [View/Amend Title]
Press Tab * 29
Wait>1.5
Press Ctrl
Send>c
Wait>1.5
Release Ctrl
//Goto the Restructure subroutine
GoSub>Narrator_Name_Restructure
SetFocus>Untitled - Notepad
WaitWindowOpen>Untitled - Notepad
Send>ncc:narrator = 
Wait>1
Press Ctrl
Send>v
Release Ctrl
Press Enter
SetFocus>Untitled - Notepad
WaitWindowOpen>Untitled - Notepad
Wait>2
Let>MSG_STAYONTOP=1
Message>Complete



SRT>Narrator_Name_Restructure
VBSTART
VBEND

//example here:
//Let>name=COOPER, Mandy

//Get the copied name from the clipboard
GetClipBoard>name

Let>comma=,
Separate>name,comma,parts

Let>firstname={lower(%parts_2%)}
Let>surname={lower(%parts_1%)}

VBEval>Trim("%firstname%"),firstname
VBEval>Trim("%surname%"),surname

Let>firstname={upper(copy(%firstname%,1,1)) + copy(%firstname%,2,length(%firstname%))}
Let>surname={upper(copy(%surname%,1,1)) + copy(%surname%,2,length(%surname%))}

Let>fullname=%firstname% %surname%
//MessageModal>fullname

//Put the restructured name back onto the clipboard for pasting
PutClipBoard>fullname
END>Narrator_Name_Restructure


I want a message to pop up once the macro has completed the job to alert our blind and visually impaired users hence why I've used:

Code: Select all

Let>MSG_STAYONTOP=1
Message>Complete

In the non compiled version this works perfectly but in the compiled version it looks like the message box does pop up but then disappears 1 millisecond later (there's just the briefest of flickers).

This is using version 10.015, am I doing something stupid or is this a known bug?

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Jun 05, 2009 2:10 pm

The message is the last line of the script. In a compiled script, when the script ends, any messages left displaying will disappear. When running a script from the Macro Scheduler menu, when the script ends, any messages left displaying will continue to display until you close them. I don't think it should be that way but it has been since I started using the software in version 6.

To get the message to display when compiled, either make it a modal message which will require the user to close the message or add a short wait at the end of the script which will display the message for X seconds or until the user closes the message.

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Try a wait statement

Post by gdyvig » Fri Jun 05, 2009 2:11 pm

Hi RNIB,

Try putting a wait after the message for however long you want the message to remain displayed. After the wait the script stops and the message disappears.

Gale

RNIB
Macro Veteran
Posts: 198
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Post by RNIB » Fri Jun 05, 2009 2:15 pm

Ahh right, I guess that does actually make sense thinking about it.

I think I'll make it a modal one.

Thanks for your help again.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts