AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Copy text from URL target

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
randallf



Joined: 06 Jul 2009
Posts: 678

PostPosted: Wed Feb 10, 2010 11:24 pm    Post subject: Copy text from URL target Reply with quote

Hello,

After much help and searching I managed to get the following together, I'd love to see if anyone has better methods. The main problem with this one is that it will fail if the page opens to a text-entry control.

This aims to load a webpage hidden, select all, copy and return.

You need AHK_L and COM_L.

Code:

WebCopyToClipboard(url)
{
  pwb := COM_CreateObject("InternetExplorer.Application")
  pwb.Visible := false ;hide this junk from the user

  pwb.toolbar := false
  pwb.statusbar := false
  pwb.menubar := false
 
  pwb.Navigate(url)
  Loop
    if (pwb.readyState = 4) ; wait for page to load
      Break
 
    ControlSend , Internet Explorer_Server1, ^a, ahk_class IEFrame
    Sleep, 100
    ControlSend , Internet Explorer_Server1, ^c, ahk_class IEFrame

  pwb.Quit() ;exit internet explorer window
 
Return Clipboard

}


Last edited by randallf on Thu Feb 11, 2010 8:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
aaffe



Joined: 17 May 2007
Posts: 1002
Location: Germany - Deutschland

PostPosted: Thu Feb 11, 2010 9:55 am    Post subject: Reply with quote

You need autohotkey_L for this to do, dont you?
Back to top
View user's profile Send private message
randallf



Joined: 06 Jul 2009
Posts: 678

PostPosted: Thu Feb 11, 2010 2:25 pm    Post subject: Reply with quote

aaffe wrote:
You need autohotkey_L for this to do, dont you?


Yes I'm sorry, I should have specified that. I only recently started using L, need to get in that habit.

This uses AHK_L and COM_L.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group