Finding typed text in Edit=msEdit

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
aboredprogrammer
Junior Coder
Posts: 40
Joined: Wed Jan 27, 2010 6:31 am

Finding typed text in Edit=msEdit

Post by aboredprogrammer » Wed Feb 03, 2010 6:20 pm

I was wondering how I can get the typed text from a msEdit box located on dialog1. When the dialog starts, the msEdit box says: "what's your mood today"

I want the user to be able to delete that text, and type something of their own, and then press the "Search" button. When the search button is pressed, the text in msEdit is copied, and pasted into a different window. Do I use %text%? I have tried with no luck.

Thanks
aboredprogrammer

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

Post by JRL » Wed Feb 03, 2010 7:30 pm

First use GetDialogAction>

GetDialogAction>Dialog1,res1


Then the variable "Dialog1.msEdit1" will exist with the typed text as its value.

If you have two or more edit boxes, their number (msEditX) will correspond with their position in the Dialog Block.

User avatar
aboredprogrammer
Junior Coder
Posts: 40
Joined: Wed Jan 27, 2010 6:31 am

Post by aboredprogrammer » Thu Feb 04, 2010 4:18 am

Thanks for the reply JRL,

However, I don't quite understand... How would I incorporate this within my script? I want the user to be able to type for example a song title in the msEdit box, then when they press "search" it pastes the typed text in the search box on itunes.

I'm not sure how the code you provided me will help me with this. Sorry for being a pain! :oops:

Thanks
aboredprogrammer

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

Post by JRL » Thu Feb 04, 2010 4:44 am

Here's a sample. Sorry, I don't have itunes to test this or make it work. So you'll have to fill in where I've commented "get to required field"

Code: Select all

Dialog>Dialog1
   Caption=Dialog1
   Width=445
   Height=250
   Top=165
   Left=48
   Button=Ok,177,163,75,25,3
   Edit=msEdit1,123,54,182,
EndDialog>Dialog1

Show>Dialog1

Label>Loop
  GetDialogAction>Dialog1,res1
  If>res1=2
    Exit>0
  EndIf
  If>res1=3
    GoSub>Process
  EndIf
  Wait>0.01
Goto>Loop

SRT>Process
  CloseDialog>Dialog1
  SetFocus>itunes*
  //Get to required field
  Send>%Dialog1.msEdit1%
  Exit>0
END>Process

User avatar
aboredprogrammer
Junior Coder
Posts: 40
Joined: Wed Jan 27, 2010 6:31 am

Post by aboredprogrammer » Thu Feb 04, 2010 5:50 am

Thank you very much JRL. Works perfectly! :D
aboredprogrammer

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