Dialog Variable Help

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Dialog Variable Help

Post by gchichester » Thu Feb 12, 2009 4:02 pm

In attempt to keep my scripts small and modular, I think I have a issue when using
Dialog Boxes variables. I have 7 scripts that run in order, Script1 calls Script2 and so on.
Script1 starts with a Dialog box that has 18 variables, after it’s closed the script continues
doing it commands and then calls Sctipt2. Which has a “Send>%DialogName.Variable%â€

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

Post by Marcus Tettmar » Thu Feb 12, 2009 4:11 pm

You don't say how you are "calling" each script. Use Include if you want each one to be global. Include literally sucks the "called" script into the "calling" script so that the code becomes one and the same. Whereas Macro just RUNS the called script which is a separate entity. With Macro> you would have to pass any variables required into the script.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Dialog Variable Help

Post by gchichester » Thu Feb 12, 2009 4:35 pm

Yes your right I’m using Macro> to call my scripts.
I checked the help file but not very helpful.
So If I understand all I need to do is
Replace Macro>script name with Include>script name and it will run/call the next script
Or does the Include>script name go at the beginning of each script I want included?
Thanks Again
Gilc

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

Post by Marcus Tettmar » Thu Feb 12, 2009 4:43 pm

Just replace Macro>script name with Include>script name

If the documentation makes no sense to you then here's a sure fire way to understand the difference. Use the debugger. Create a simple script with one Include line, which calls another script. Open it in the editor and use F8 to step through the code. When yuou get to the Include like you'll see the included script lines appear in the editor. So it's as if the included code was PART of the script.

In contrast when you step past a Macro> line all that happens is that the macro gets executed. But the code is not "included".
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Dialog Variable Help

Post by gchichester » Thu Feb 12, 2009 5:24 pm

Marcus,
It worked as advertised.

Thank you for making using Macro Scheduler more fun to use.

Gilc

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Dialog Variable Help

Post by gchichester » Thu Feb 12, 2009 6:06 pm

Marcus,
Now I have a strange upper/lower case issue happening with my variables.
I have "CapsOn" at the begging of my script, all may Dialog input shows
in upper case but when I send> it to my program it's all lower case, yes
I have verified that my caps lock is working correctly in my program.
I even add a message box to show my variable output and it's correct.
What makes this even stranger is I have another dialog that works just fine. Have any ideas about this one. I'm really puzzled.

Thanks
Gilc

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

Post by Marcus Tettmar » Thu Feb 12, 2009 6:24 pm

You probably have Press Shift somewhere without a corresponding Release Shift thus those keys are being sent with Shift down which, with caps lock on, will result in lower case.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Thu Feb 12, 2009 7:41 pm

What is the status of the physical keyboard caps lock? That can affect the characters sent by Send>

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Dialog Variable Help

Post by gchichester » Thu Feb 12, 2009 10:35 pm

Marcus, Me_Again,
I searched all macros in question and I don't have a missing Release Shift.
I started the script with the caps lock off and watched the light while running the script and
it came on and never went off, but the Send>variable is still lower case.
Hoping for more ideas!

Gilc

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Fri Feb 13, 2009 12:41 am

When I read carefully what you wrote "I have "CapsOn" at the begging of my script, all may Dialog input shows in upper case but when I send> it to my program it's all lower case" then what you are seeing is normal.

If you Send>ABCDEF with the keyboard caps lock OFF, the result is "ABCDEF" but if you have the keyboard caps lock ON the result is a change of case so the result will be "abcdef".

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

Post by JRL » Fri Feb 13, 2009 12:46 am

Sending text with caps on is like sending text with the shift key down. The text will come out opposite case from what you send. Remove capson> from your script and send the text in the case you want to see it. I think of CapsOn and CapsOff as a convenience for setting the case for user input.

For proof, run this simple script. Sometimes simple testing goes a long way toward explaining "oddities".

[code]
run>notepad.exe
Wait>5

capson
Send>UPPER
Press Enter
send>lower
[/code]

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Fri Feb 13, 2009 1:22 am

Maybe add a CapsOff to ensure that the user hasn't set it on manually, which would result in the same case switch.

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Dialog Variable Help

Post by gchichester » Fri Feb 13, 2009 2:05 am

Me_Again, JRL
Thanks to both of you – Each had a piece of the puzzle that I needed.
I just had put them together in the right order.
It sure is nice when it all come together.

Gilc

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Dialog Variable Help Continued

Post by gchichester » Tue Feb 17, 2009 9:13 pm

I'm running a Dialog called Cont5_Dlg with vars ContNum & SNum_L1
When I run the test message below everthing works but %SN%
It's So simple, but I can't figure out why.
Help Please

Let>%Cont5_Dlg.SNum_L1% = SN
Message>%Cont5_Dlg.ContNum_L1%, %Cont5_Dlg.SNum_L1%, %Cont5_Dlg.ContCount%, %SN%

Also is there away to paste images in this post?
It would be nice to paste the message box here.

Thanks
Gilc[/img]

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Feb 17, 2009 10:19 pm

You have "Let>%Cont5_Dlg.SNum_L1% = SN "

You should remove the %s and the spaces before and after the "=". Also remove any trailing space at the end of a line. Macro Scheduler reads the space characters literally, they are not a delimiter.

Try: Let>Cont5_Dlg.SNum_L1=SN


========================================
You can insert images on the post with the Img button and/or type in the code [img]http://image_url[/img].., The link must be available on the Internet, it is not uploaded to this site. There are a couple of free sites to store images, including http://tinypic.com.

Here is a snapshot of the Img* button using tinypic.com:
Image
The actual code is {IMG}http://i39.tinypic.com/1zg876c.jpg{/IMG}
(I have disabled HTML and am using braces "{ }" vs. brackets "[ ]" for display on the forum).
Last edited by Bob Hansen on Wed Feb 18, 2009 12:15 am, edited 2 times in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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