Jump to content

Embedded IE - Copying content


 Share

Recommended Posts

  • Moderators

Even a manual right-click Copy, right-click Paste does not work from an embedded IE object in 3.3.10.0 and 3.3.11.3 on WIN7 x64.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I find that the issue is present using Vista x86 and 3.3.10.2 and beta 3.3.11.3. I can't CTRL-C highlighted text, and I can't right click/copy the text either, it never gets into the clipboard running the script.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

I have the same problem, ive tried it on different computers and OS's. This is my temporarily solution.

I will rewrite it so everyone can use it.

local $app_focus = true

Func dedu_copy()
       $oText = $oIE.document.selection.createrange.text
  ClipPut($oText)
EndFunc


hotkeyset("^c","dedu_copy")
 
and I use this in my while loop.
 
if wingettitle("[ACTIVE]") = "My programs title" then
 hotkeyset("^c","dedu_copy")
else
hotkeyset("^c");Will remove the hotkeyset by autoit.
endif
 
 
however, i havent figured out how to make the "right click" to work.
 
 
edit: i have tried on IE11 and IE8, same result...
Edited by tarretarretarre
Link to comment
Share on other sites

I know that the IE UDF has been rewritten in parts for AutoIt > 3.3.8.1. Can someone grab the IE UDF from AutoIt version 3.3.8.1 and test it with a 3.3.10.x or 3.3.11.x script?

So we know if the problem is caused by AutoIt, IE or the IE UDF.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • 2 weeks later...

After hours of trying to troubleshoot the problem with copying from an embedded IE, I found this and registered just to thank DiscoSeb and everyone else here for diagnosing the issue.

3.3.10 just came out at the end of December and there's already a bug report filed. Nice work.

I will downgrade to 3.3.8.1 until this is fixed, but at least I can stop driving myself crazy debugging this script. I tend to assume the problem is my own fault, so it's nice in this case that it wasn't. ^_^

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
  • Moderators

Water, my apologies, I had this thread on my watch list, and totally missed your question in post #25. I did take the 3.3.8.1 IE and try it on a 3.3.10.x script (below), and am unable to copy content.

On a machine with 3.3.8.1, however, the script works fine. Also, I have noticed (aside from being unable to copy content) that the page does not refresh when using the Back button. If I am reading a thread, for example, and click Back to go to GH&S, the thread is not marked as read. If I click on the GH&S button however, it is.

I am going to add this additional info into the Trac ticket, but thought I would post here for anyone else keeping up with the thread.

Test script:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <Misc.au3>

Opt("TrayIconDebug", 1)
 
Local $oIE = _IECreateEmbedded()
$myGUI = GUICreate("Embedded IE Example", 1024, 768, 1, 1,$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
GUICtrlCreateObj($oIE, 10, 60, 1004, 700)

$left = 5
$top = 10
$width = 80
$height = 20

$general = GUICtrlCreateButton("General Help", $left, $top, $width, $height)
 $left += 85
$chat = GUICtrlCreateButton("Chat", $left, $top, $width, $height)
 $left += 85
$devchat = GUICtrlCreateButton("Dev Chat", $left, $top, $width, $height)
 $left += 85
$mvpchat = GUICtrlCreateButton("MVP Chat", $left, $top, $width, $height)
 $left += 85
$usermod = GUICtrlCreateButton("User Mod", $left, $top, $width, $height)
 $left += 85
$gui = GUICtrlCreateButton("GUI", $left, $top, $width, $height)
 $left += 85
$examples = GUICtrlCreateButton("Example Scripts", $left, $top, $width, $height)
 $left += 85
$wiki = GUICtrlCreateButton("Wiki", $left, $top, $width, $height)
 
$left = 5
$top = 35

;IE Navigation
$home = GUICtrlCreateButton("Home", $left, $top, $width, $height)
 $left += 85
$back = GUICtrlCreateButton("Back", $left, $top, $width, $height)
 $left += 85
$fwd = GUICtrlCreateButton("Fwd", $left, $top, $width, $height)
 $left += 85
$stop = GUICtrlCreateButton("Stop", $left, $top, $width, $height)
 $left += 85
$refresh = GUICtrlCreateButton("Refresh", $left, $top, $width, $height)
 $left += 85
$exit = GUICtrlCreateButton("Exit", $left, $top, $width, $height)
GUISetState()
 
_IENavigate($oIE, "http://www.google.com")
 
While 1
    Local $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $general
            _IENavigate($oIE, "http://www.autoitscript.com/forum/forum/2-general-help-and-support/", 0)
        Case $msg = $chat
            _IENavigate($oIE, "http://www.autoitscript.com/forum/forum/6-chat/", 0)
        Case $msg = $devchat
           _IENavigate($oIE, "http://www.autoitscript.com/forum/forum/7-developer-chat/", 0)
        Case $msg = $mvpchat
           _IENavigate($oIE, "http://www.autoitscript.com/forum/forum/27-mvps-private-chat/", 0)
        Case $msg = $usermod
           _IENavigate($oIE, "http://www.autoitscript.com/forum/forum/28-user-moderation/", 0)
        Case $msg = $gui
           _IENavigate($oIE, "http://www.autoitscript.com/forum/forum/10-graphical-user-interface-gui-help-and-support/", 0)
        Case $msg = $examples
          _IENavigate($oIE, "http://www.autoitscript.com/forum/forum/9-example-scripts", 0)
        Case $msg = $wiki
          _IENavigate($oIE, "http://www.autoitscript.com/wiki", 0)
        Case $msg = $home
          _IENavigate($oIE, "http://www.google.com", 0)
        Case $msg = $back
          _IEAction($oIE, "back")
        Case $msg = $fwd
          _IEAction($oIE, "forward")
        Case $msg = $stop
          _IEAction($oIE, "stop")
          _IEAction($oIE, "stop")
        Case $msg = $refresh
          _IEAction($oIE, "refresh")
        Case $msg = $exit
          Exit
EndSelect

WEnd

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • 1 month later...
Link to comment
Share on other sites

  • 1 month later...
  • Moderators

I honestly have not spent any amount of time looking into the root cause, as I have a single script that makes use of IE (the one I use to view this forum). I ended up just compiling it under 3.3.8.1.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I thought it was apparent that IE UDF is not the problem.

More likely to be something with the object creation.

Thanks JohnOne. Can you elaborate on that? Afraid I don't understand. Also, is there a way to tackle how the object is being created?

I just noticed 3.3.12.0 has been up since the beginning of this month, but now I know it won't matter if I upgrade (both from the changelog and what you just posted). I'll upgrade of course though.

Link to comment
Share on other sites

  • 1 month later...
  • Moderators

Do you have a reproducer to post, to show what is working for you? I tried this morning with the latest BETA, and the example script in the help file, and it is still not working.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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