Jump to content

Paste HTML source from clipboard


Recommended Posts

Hi,

I want to paste an html source from clipboard to a window, but I don't have any idea how to do it.

Here is the script that I wrote

#include <INet.au3>
ClipPut (_INetGetSource('www.google.com'))
ClipGet ()

;A short paste via keyboard. It's not working
Send ("{CTRLDOWN}")
Send ("V")
Send ("{CTRLUP}")

Do you know any other command that pastes from clipboard?

Edited by Vladi243
Link to comment
Share on other sites

Hi,

I want to paste an html source from clipboard to a window, but I don't have any idea how to do it.

Here is the script that I wrote

#include <INet.au3>
ClipPut (_INetGetSource('www.google.com'))
ClipGet ()

;A short paste via keyboard. It's not working
Send ("{CTRLDOWN}")
Send ("V")
Send ("{CTRLUP}")

Do you know any other command that pastes from clipboard?

Send("^v") and the ClipPut() is doing you no good in this case. You will probably need a time delay between the ClipPut() and The Send() lines as well.

Edit: After re-reading your post, does the window that you want to paste to have an identifiable control where you want the text placed? If the answer is yes, then it's a different process.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Send("^v") and the ClipPut() is doing you no good in this case. You will probably need a time delay between the ClipPut() and The Send() lines as well.

Edit: After re-reading your post, does the window that you want to paste to have an identifiable control where you want the text placed? If the answer is yes, then it's a different process.

Send ("^v") isn't working.

No, the window that I want to paste to doesn't have an identifiable control.

Link to comment
Share on other sites

Send ("^v") isn't working.

No, the window that I want to paste to doesn't have an identifiable control.

That sometimes is the case but just to be sure, open the window and use Au3Info.exe to see what that returns.

There is the possibility that the ^v is being sent before the window is active.

What happens if you run this

#include <INet.au3>
ClipPut (_INetGetSource('www.google.com'))
WinActivate("My Window Title")
WinWaitActive("My Window Title")
Sleep(2000); 2 seconds to make sure the cursor is where you want the text
Send("^v")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I tried it, and there is no reaction.

Try this just as a test.

ClipPut( "This is just a test string")

Sleep(10000) ; 10 second delay use it to open the window and place your cursor where you want it.

Send("^v") ;; There is a difference between Send("^v") and Send("^V") so get it right.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...