Jump to content
Macro Express Forums

"Clipboard Paste" or "Type Clipboard Text" not working as intended


Recommended Posts

Howdy,

 

Background: 

I used to very fluent in coding MEP. But now it's been 3-4 years since I had to do anything serious with it. Now I need to. By now, I probably could have manually completed this, but as the OCD and stubborn among us know, "that's not the point"! Macro Express Pro has grown and evolved a bit since then.  

 

Problem:

So I'm trying to copy data from a (Excel) CSV file in to a web page - it's just simple street address data (e.g.: "1313 Mockingbird Lane".  I have maybe 30 records. 
I use a "ASCII File Begin Process" to read the CSV 1 record at a time. 
I have a check in my macro to display the contents of the clipboard. So far, so good.  I see the first address contents. Looks good. 
BUT! When I do a "Clipboard Paste" OR "Type Clipboard Text" in the desired webpage field, I get something bizarre.  Here is what I get, regardless of the true contents of the clipboard. Here's what's getting pasted:  "<DELAY Flags="\x02" Time="500"/>" (No quotes). 

Interestingly, I do have a 500ms delay before and after the actual paste command. So it appears as if the macro instruction itself is getting pasted in to the web form instead of the clipboard contents. 

Any guess why this is happening?  Any help, hints, tips, etc; are appreciated.  A quick search of the MEP knowledge base and Google didn't turn up anything useful, but I may've been using weak search terms or something. 

Many Thanks, 

--Pete

Link to comment
Share on other sites

Maybe you have the script editor focused and it's copying what you have highlighted. That is the raw text of the delay command. How are you setting the clipboard contents? And why? You should focus your destination control and use the Text Type command where you can opt to paste. 

Please show your code. Give us a simple example.

 

Link to comment
Share on other sites

Hi Cory,

 

Thanks much!  Nailed it. Case closed!

Still not sure how the clipboard was getting that delay value text instead of the desired info - but if I've learned nothing else in 30+ years in IT, it's that sometimes it doesn't pay to play "Data Detective".  I'm not sure it was getting the value from the code itself or where - but that makes the most sense, but I'm puzzled since the macro window was minimized at the time. But moving on...

 

YES!!  Use of "GET CONTROL",  "SET FOCUS" and "TEXT TYPE" for the win! Unfortunately the exact field of the webform doesn't have a unique control value, I can TAB from the first field to where I need to get.  I could use X,Y coords but I think this will be more consistent if the window should ever be moved slightly, etc. 

Thanks for putting me on the scent!  Greatly appreciate your help!

 

--Pete

Link to comment
Share on other sites

Many tricks one can do in a web form. Tab counting I used mostly, but sometimes it's variable. So I will search for some text, usually a filed label, then tab from there. 

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