Code builders

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Aditi
Newbie
Posts: 3
Joined: Mon Mar 19, 2012 7:17 am

Code builders

Post by Aditi » Mon Mar 19, 2012 8:25 am

Hi, we have installed the trial version of macro scheduler. we find that some of the code builder functions which are provided did not work when used in the script like, Gettreenode, push button, setfocus etc. Please help
Last edited by Aditi on Tue Mar 20, 2012 1:56 pm, edited 3 times in total.

User avatar
Phil Pendlebury
Automation Wizard
Posts: 543
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Mon Mar 19, 2012 11:22 am

Please post some exact code.

Show an example how you are trying to use it in a script.
Phil Pendlebury - Linktree

Aditi
Newbie
Posts: 3
Joined: Mon Mar 19, 2012 7:17 am

Post by Aditi » Mon Mar 19, 2012 1:32 pm

Phil Pendlebury wrote:Please post some exact code.

Show an example how you are trying to use it in a script.
Hi Phil,

Here is a sample code we tried to check a check box(Directory Create) using SetCheckBox function from the code builders, but it didn't work. Please let us know if there is any other method to select checkbox. Thankyou.

WaitWindowOpen>General
Send>TestDir
Press Tab
Send> Description
Wait>2.61
MouseMove>30,108
Wait>1.96
LClick
Wait>1.35
Let>WF_TYPE=1
GetCheckBox>New Window,Directory Create,res
If>res=1,checked,unchecked
Label>checked
Let>WF_TYPE=1
SetCheckBox>New Window,Directory Create,FALSE
Goto>end
Label>unchecked
SetCheckBox>New Window,Directory Create,TRUE
Label>end

User avatar
Phil Pendlebury
Automation Wizard
Posts: 543
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Mon Mar 19, 2012 2:47 pm

Ok thanks,

First of all you mentioned in your original post that SetFocus> doesn't work. So unless you were just writing that without testing it, it would seem that your actual window titles are wrong.

Having said that, GetCheckBox> is not always guaranteed to work.

So try this.

Make sure you have the exact window name of the window you want to operate on.

To test set focus simply start this script then put another window on top of the one you want to work on and wait 3 seconds... If setfocus is working and you have the correct window name then the window will of course come to the front of the screen.

Code: Select all

Wait>3
SetFocus>YOURWINDOWNAME*
Wait>0.5
GetCheckBox>YOURWINDOWNAME,OBJECTCAPTION,result
MDL>result
What result do you see if you run this?
Try ticking the box first and then try it again unticking it.
What do you see?
Phil Pendlebury - Linktree

Aditi
Newbie
Posts: 3
Joined: Mon Mar 19, 2012 7:17 am

Post by Aditi » Tue Mar 20, 2012 7:36 am

Thanks for the help. I used the above code in my script, On running the script it shows -1 in the message box. Did the command failed to locate the given check box? I have mentioned correct WINDOW NAME and OBJECT CAPTION.To select checkbox is there any other method other than SetCheckBox ?

User avatar
Phil Pendlebury
Automation Wizard
Posts: 543
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Thu Mar 22, 2012 5:30 pm

Yes it looks like your check box was not identified. Some else may be able to suggest another (less simple) way.
Phil Pendlebury - Linktree

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