endlessdragon Posted July 16, 2007 Report Share Posted July 16, 2007 I have a question I was wondering if anyone could help me out. I'm trying to make a macro that copies text from a text box and pastes it into another text box in a different window. I'm using the mouse move command to get the location of the input boxes, but ideally I'd want it to locate the input box without using the mouse move command. Here is my code: Activate Window "A" Moust Move Window 235, 327 Mouse Left Button Click Text Type: <CONTROL>a Clipboard Copy Variable Set String %T1% from Clipboard Activate Window "B" Mouse Move Window 243, 438 Mouse Left Button Click Text Type: %T1% As you can see, not the best way to do things. Any ideas? Quote Link to comment Share on other sites More sharing options...
iceman Posted July 16, 2007 Report Share Posted July 16, 2007 My suggestion is to open Help, select Index tab, type Controls. Your request will more than likely be solved with command Variable Get Control Text ("sets a T-variable to the text contained in a control") and Variable Set Control Text. Quote Link to comment Share on other sites More sharing options...
endlessdragon Posted July 16, 2007 Author Report Share Posted July 16, 2007 thanks for the reply, but i'm still not getting it by going to the Help menu. Can you be a bit more specific with the exact command I would use to do this? Quote Link to comment Share on other sites More sharing options...
iceman Posted July 16, 2007 Report Share Posted July 16, 2007 Copy and paste this code in a macro and modify with your source and destination boxes. <ACTIVATE2:Notepad><GETCONTROL2P:01:NOTEPAD.EXE:NotepadNotepad001:1Edit><VARGETCONT:1:1><ACTIVATE2:UltraEdit-32><DIS:<GETCONTROL2P:02:UEDIT32.EXE:Afx:400000:8:10011:0:bc066bUltraEdit-32004:1MDIClient1Afx:400000:b:10011:6:13007e71AfxMDIFrame42s4EditControl><DIS:<VARSETCONT:2:%T1%><TEXTTYPE:%T1%> Get your source and destination windows running. Start a new macro. Click Get Control command from Window Controls section of Scripting Editor. Check Hide Macro Express. Click Launch Get Control Utility. Place your mouse over the crosshairs. Click and drag to your source text box. Release mouse. Click Save. Click OK. Repeat prior for destination text box, but select C2 for destination box before doing the crosshairs part. You can then use the typing of %T1% or the Variable Set Control Text command. Quote Link to comment Share on other sites More sharing options...
endlessdragon Posted July 17, 2007 Author Report Share Posted July 17, 2007 what am i still doing wrong? it's not working. <ACTIVATE2:Player><GETCONTROLP:01:FIREFOX.EXE:007:MozillaUIWindowClassPlayerMozillaWindowClassMozillaWindowClassMozillaW ndowClassMozillaContentWindowClassMozillaWindowClassMozillaWindowClass><VARGETCONT:1:1><ACTIVATE2:Hermes | Transaction Entry><GETCONTROLP:02:FIREFOX.EXE:007:MozillaUIWindowClassHermes | Transaction EntryMozillaWindowClassMozillaWindowClassMozillaWindowClassMozillaContent indowClassMozillaWindowClassMozillaWindowClass><TEXTTYPE:%T1%> Quote Link to comment Share on other sites More sharing options...
endlessdragon Posted July 17, 2007 Author Report Share Posted July 17, 2007 btw i get a fatal error when trying to run this macro Quote Link to comment Share on other sites More sharing options...
endlessdragon Posted July 18, 2007 Author Report Share Posted July 18, 2007 anyone? Quote Link to comment Share on other sites More sharing options...
iceman Posted July 18, 2007 Report Share Posted July 18, 2007 I believe the problem with the code you tried is because the input box seems to be in Firefox. The suggestion I gave before works well with stable windows GUIs, not web browsers. Being that your source and destination windows are Firefox, I would suggest using the Tab key to get to your in and out fields. Maybe go to some known set position on the webpage/window via the keyboard (e.g. Alt+D takes the cursor to the Address field of Firefox). Then use tab however many times to get to the fields. I understand you don't want to move the mouse, but you could save the mouse's current position, <MOUSEPOS:T:01:02> , move the mouse to a generic spot above the text box (You may want to go to the top of the page Ctrl+Home, click near the upper left hand corner of the page/window), press tab however many times to get to the field. (You may not have to Ctrl+A if the text is already selected.) And repeat on the destination window/page. Then restore the mouse to where you had before starting the macro <MMS2:1N,1N> , or some other desirable position. Hope it helps. iceman Quote Link to comment Share on other sites More sharing options...
wbeldman Posted July 19, 2007 Report Share Posted July 19, 2007 I've never used this in production and certainly not in Firefox, but it's probably worth the experiment... Ctrl+F Find dialog unique label text The text before the input-tag (doesn't matter whether its in a real label-tag or just some designating text before the input) Enter Find it, select (highlight) it Esc Close the Find dialog TAB To the input field Make shure the label can be found or handle the not found popup! Quote Link to comment Share on other sites More sharing options...
iceman Posted July 19, 2007 Report Share Posted July 19, 2007 Good idea wbeldman. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.