Sign in to follow this  
Followers 0
Ace08

copy text

5 posts in this topic

Hi guys im new in this forum and apparently new with autoit, im just wondering because i made a script to copy text in a file and these text can be either to many or just a few then paste them on a notepad the thing is even if the script isn't finished with copying it starts to paste it in the notepad. my question is, is there a way for autoit to pause then resume after it fully copies the text? i've tried sleep but there are times its not enough and a high number for sleep can be a pain if the script is only copying 2 or 3 words... would appreciate your help and thanks in advance


Work smarter not harder.My First Posted Script: DataBase

Share this post


Link to post
Share on other sites



Welcome on this forum!

To make it help you easier could you please post the code you have so far?

Use the autoit-tags to enclose the code (click on the square blue icon with an A above the text box)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks water for the quick reply here is the code i've used sofar most of them are sendkeys sendkeys

#include <IE.au3>

$sURL = "C:\AutoitScripts\global.html"

$oIE = _IECreate($sURL)
SendKeepActive("C:\AutoitScripts\global.html")
Send("+{F10}")
Sleep (150)
Send ("{A}")    
Sleep (1500)    
Send("+{F10}")
Sleep (150)
Send ("{C}")      
Sleep (10000)
Run("notepad.exe")
WinWait("[CLASS:Notepad]")
SendKeepActive("[CLASS:Notepad]")
Sleep (10000)
Sleep (150)
Send("!e")
Sleep (150)
Send("p")

if possible i would like to change sleep (10000) since the files can have large amount of texts or otherwise... also although the file is an html file it contains only texts....

Edited by Ace08

Work smarter not harder.My First Posted Script: DataBase

Share this post


Link to post
Share on other sites

How does this work for you?

#include <IE.au3>
$sURL = "C:\AutoitScripts\global.html"
$oIE = _IECreate($sURL)
$sText = _IEPropertyGet($oIE,"innertext") ;save all visible text to a variable.
Run("notepad.exe")
$hWnd = WinWait("[CLASS:Notepad]")
ControlSetText($hWnd,"","Edit1",$sText) ;place the text into the edit control of notepad.

Share this post


Link to post
Share on other sites

whoa! thanks a lot Tvern not only the sleep command were removed but this is also short Thanks a lot.... i'm loving autoit ;)


Work smarter not harder.My First Posted Script: DataBase

Share this post


Link to post
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
Sign in to follow this  
Followers 0