Copy value from editbox

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Alpha_AI
Pro Scripter
Posts: 61
Joined: Wed Sep 19, 2007 9:30 am

Copy value from editbox

Post by Alpha_AI » Sat Sep 22, 2007 11:27 am

Im trying to copy a value from a editbox and modify the value
and repaste it into the box with the new value

//BEGIN Copy
Press CTRL
Send>c
Release CTRL
//END Copy

**BREAKPOINT**
let>$Clipboard = 0
GetClipBoard>$clipboard
let>$Clipboard = $Clipboard - 50
Send>$Clipboard
Press Enter

now i know this is wrong let>$Clipboard = $Clipboard - 50
because in the watch list it says $Clipboard = $Clipboard - 50
and not the new value
eg. $Clipboard = 30 if original $Clipboard is 80

Any clues?

Ben

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Sat Sep 22, 2007 12:37 pm

Use View System Windows from the Tools menu to find the name of the Window Containing your edit box and the object name of the edit box itself, then use GetControlText> to read into a variable. No need to use Copy/Paste as long as you are dealing with a Windows app.

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 » Sat Sep 22, 2007 5:22 pm

Two more observations:

1. If you do need Send> you need to set Focus on window before you do a Send

2. Remove spaces in Let> commands, and most others also. Macro Scheduler sees them as real and tries to use them.

From: Let>$Clipboard = 0 (means "Clipboard " = " 0")
To: Let>$Clipboard=0
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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

Post by Marcus Tettmar » Sat Sep 22, 2007 7:54 pm

>2. Remove spaces in Let> commands, and most others also.
>Macro Scheduler sees them as real and tries to use them.

Unless you set IGNORESPACES to 1 (See the "Ignoring Spaces" section in the help file).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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