| View previous topic :: View next topic |
| Author |
Message |
artbasement
Joined: 01 Sep 2008 Posts: 47
|
Posted: Sat Sep 06, 2008 1:01 am Post subject: How to extract a Subtotal from Window and send it? |
|
|
I am able to read the whole text from a window and send it to an entry field (or text field for testing), but how can I only send the money amount shown (i.e. 29.95)? Also, is it possible once it is sent to the entry field to make the number dissappear, if I start to type a different number (like 30.00 tendered). (I tried to copy and paste into the field without success) The code is like this so far....
| Code: | Enter::
{
WinWait, ShopAssist
WinGetText, sub ; The window found above will be used.
FileAppend, %sub%, subtotal.txt
}
Return |
And the text file it produces is...
| Quote: | &3 - Cheque
&2 - Credit Card
&1 - Cash
Panel22
Panel23
Panel2
29.95
Any
Ne&w Hire
Price Loo&kup
Item &Discount
&Sale Discount
P&rint
Ca&ncel
C.&O.D.
&Cash
&Amt Tendered
&Unlisted Item
Card
Char&ge Account |
|
|
| Back to top |
|
 |
Slanter
Joined: 28 May 2008 Posts: 397 Location: Minnesota, USA
|
Posted: Sat Sep 06, 2008 1:21 am Post subject: |
|
|
maybe something like this? | Code: | Enter::
{
WinWait, ShopAssist
WinGetText, sub ; The window found above will be used.
RegExMatch(var,"\d+\.\d{2}",sub)
FileAppend, %sub%, subtotal.txt
}
Return |
_________________ Unless otherwise stated, all code is untested
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination. |
|
| Back to top |
|
 |
artbasement
Joined: 01 Sep 2008 Posts: 47
|
Posted: Sat Sep 06, 2008 8:16 am Post subject: |
|
|
Unfortunetly the script returns nothing, but returns everything with line below removed...any ideas?
| Code: | | RegExMatch(var,"\d+\.\d{2}",sub) |
|
|
| Back to top |
|
 |
Serenity
Joined: 07 Nov 2004 Posts: 1276
|
Posted: Sat Sep 06, 2008 11:19 am Post subject: |
|
|
Try changing var to sub:
| Code: | | RegExMatch( sub,"\d+\.\d{2}", sub ) |
_________________ "Anything worth doing is worth doing slowly." - Mae West
 |
|
| Back to top |
|
 |
artbasement
Joined: 01 Sep 2008 Posts: 47
|
Posted: Sat Sep 06, 2008 12:02 pm Post subject: |
|
|
Cool, thanks it worked!  |
|
| Back to top |
|
 |
Slanter
Joined: 28 May 2008 Posts: 397 Location: Minnesota, USA
|
Posted: Sat Sep 06, 2008 8:33 pm Post subject: |
|
|
oops, forgot to change that back after testing it  _________________ Unless otherwise stated, all code is untested
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination. |
|
| Back to top |
|
 |
|