Jump to content
Macro Express Forums

Copy And Paste From Input Field


endlessdragon

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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%>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...