Ampersand (&) in a dialog label

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

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

Ampersand (&) in a dialog label

Post by JRL » Wed May 14, 2008 3:04 pm

Is there any way to get an ampersand (&) to display in a dialog? Is it a character with a special function in dialogs?

I tried normal stuff and resorted to the following but this didn't work either.

Code: Select all

Let>text={"this a test & this is a test"}

Dialog>Dialog1
   Caption=Dialog1
   Width=445
   Height=99
   Top=CENTER
   Left=CENTER
   Label=%text%,72,24
EndDialog>Dialog1

show>dialog1,res1

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Wed May 14, 2008 3:39 pm

Like this:

Code: Select all

Let>text={"this a test && this is a test"}

Dialog>Dialog1
   Caption=Dialog1
   Width=445
   Height=99
   Top=CENTER
   Left=CENTER
   Label=%text%,72,24
EndDialog>Dialog1

show>dialog1,res1

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

Post by JRL » Wed May 14, 2008 3:47 pm

Thanks Rain, that works.... :D

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed May 14, 2008 5:43 pm

An ampersand before a character marks that character as the shortcut key, and underlines it. To make an ampersand visible specify two together, as Rain has shown.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed May 14, 2008 7:54 pm

Hi Rain,

Thanks for sharing that... good to know.

Hi Marcus,

On searching the Help File just for the & character... I find... it won't let you. & must be a special character to the chm help as well.

I searched in other ways and the only references I could find in the Help file as to the special meaning and use of & was in the Help topics on the GetCheckBox and SetCheckBox commands, for example:
Help File wrote:SetCheckBox

SetCheckBox>window_title,object_caption,TRUE|FALSE

SetCheckBox is used to check or uncheck a given checkbox or radio button. Specify the window title of the window containing the check box/radio button, and the object's caption. The caption of a check box or radio button is the text appearing next to it. The caption must be specified accurately with attention paid to case. Where a letter is underlined indicating a shortcut key, enter the '&' character before it.
I am imagining you might have a list for updates to Help file topics. If so, would you consider adding a note in the "Dialog" topic about this special character? i.e. to display the & char as part of a label, use &&...

...and thanks for your continuing efforts in keeping the Help file up-to-date.

P.S. If "&&" is already covered in the Help file somewhere, please let me know where.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed May 14, 2008 8:00 pm

I seem to make the mistake of taking things for granted - the ampersand is used in Windows to signify the shortcut key. So if you want to use ampersand you need to specify it twice. This is a Windows thing not a Macro Scheduler thing. While I perhaps shouldn't take for granted this knoweldge there is a limit to what Windows info can be in the help file. But I'll make a note to mention this. If I documented everything that anyone is ever likely to want to know the help file would be bigger than the bible.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed May 14, 2008 8:20 pm

mtettmar wrote:I'll make a note to mention this.
Thanks :)
mtettmar wrote:If I documented everything that anyone is ever likely to want to know the help file would be bigger than the bible.
True... but think of it like this. As you've mentioned before, professional Windows Programmers are not the main target audience for Macro Scheduler. The bulk of your users are probably non-programmers trying to automate something on their PC. Now consider it was JRL who asked the question... JRL who is an absolute wizard with dialogs... so that makes me think that very few of your users are going to just know this (way to go Rain) therefore... the bulk of your users might appreciate this in the Help file.

Thanks again
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Djek
Pro Scripter
Posts: 147
Joined: Sat Feb 05, 2005 11:35 pm
Location: Holland
Contact:

Post by Djek » Thu May 15, 2008 7:34 pm

mtettmar wrote:
If I documented everything that anyone is ever likely to want to know the help file would be bigger than the bible.

True... but think of it like this. As you've mentioned before, professional Windows Programmers are not the main target audience for Macro Scheduler. The bulk of your users are probably non-programmers trying to automate something on their PC. Now consider it was JRL who asked the question... JRL who is an absolute wizard with dialogs... so that makes me think that very few of your users are going to just know this (way to go Rain) therefore... the bulk of your users might appreciate this in the Help file.
I'm totally in love with your help-file.
Many times, if I cant get to sleep, I take a part of the printout and start reading...
8)

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri May 16, 2008 9:59 am

Djek wrote:I'm totally in love with your help-file.
Many times, if I cant get to sleep, I take a part of the printout and start reading...
8)
See... Keep up the good work Marcus! :wink:
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri May 16, 2008 11:24 am

Erm, I'm not sure that was meant as a compliment ....
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri May 16, 2008 5:00 pm

mtettmar wrote:Erm, I'm not sure that was meant as a compliment ....
Maybe not... but whatever raises the profile and quality of the lowly Help file... I am all for.

For those that don't think its important, try to make use of all the new commands in a new release of Macro Scheduler without referring to the Help file.

So like I said Marcus, keep up the good work... The Help file its often taken for granted but its more important that some might think.

For instance, let's say you try out a new utility of some complexity and the Help file is total garbage... how much time do you spend with it? Not only does it make that utility hard to use... it also reflects poorly on the code... for if the Help is full of errors... so might the code be. I'd be moving on to something else pretty quick.

And for those that use it as a sleep aid, well, I count that as a benefit too! :lol:

Take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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

Post by JRL » Fri May 16, 2008 11:28 pm

mtettmar wrote:An ampersand before a character marks that character as the shortcut key, and underlines it. To make an ampersand visible specify two together, as Rain has shown.
Yes that's true for an item that performs a function such as a button. My concern was specifically for a label. I would expect a label to handle an ampersand as text.

Moving on the the issue of help files as a sleep aid. (I thought djek's comment was funny... I think that was the intent.) Most help documents for most software packages are written in a reference format. That is, they are meant to be a reference for users who already have an idea what they are doing. There are tutorials to help people get started and begin to understand how the software works. There is also the magic "Record a Macro" capability. After that the help documentation in a reference format should be adequate even desirable for expediency. One thing that is lacking for Macro Scheduler is that 1800 page hard cover edition of "The Macro Scheduler Bible" and its accompanying 200 page paperback "Macro Scheduler for Dummies" Perhaps someone will write those someday. In the mean time, there is ample reading for someone getting started with Macro Scheduler.

In my opinion, the main problem for advanced users of Macro Scheduler seeking help, is the expansive nature of this software. Because Macro Scheduler is so flexible, because it touches on nearly every aspect of the Microsoft Windows operating system and is capable of interacting with practically any program ever written to run on the Windows platform, an all encompassing manuscript for Macro Scheduler would be.... what?...Everything ever written about Microsoft Windows and all Windows compatible software?

Just a thought,
Dick

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