Jump to content
Macro Express Forums

Copy And Paste From Input Field


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.



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.

ndowClassMozillaContentWindowClassMozillaWindowClassMozillaWindowClass><VARGETCONT:1:1><ACTIVATE2:Hermes | Transaction Entry><GETCONTROLP:02:FIREFOX.EXE:007:MozillaUIWindowClassHermes | Transaction EntryMozillaWindowClassMozillaWindowClassMozillaWindowClassMozillaContent

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,


, 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


, or some other desirable position.


Hope it helps. :)



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.

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.

  • Create New...