Sign in to follow this  
Followers 0
tontoconty

Copy text from file for pasting to another file

5 posts in this topic

I have looked through help files and example scripts but still stuck. Is a baby question I know .

; Script Start - This is a script to copy text from a web page into a spreadsheet in text format

;ClipPut(^c); This is to copy highlighted text from an HTML file and does not work

WinActivate("Microsoft Excel - 0616timesheet"); this works when I key use control copy then activate the script

WinWaitActive("Microsoft Excel - 0616timesheet")

Send("!est{ENTER}")

Send ("{TAB}")

Send ("!{TAB}")

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I have looked through help files and example scripts but still stuck. Is a baby question I know .

; Script Start - This is a script to copy text from a web page into a spreadsheet in text format

;ClipPut(^c); This is to copy highlighted text from an HTML file and does not work

WinActivate("Microsoft Excel - 0616timesheet"); this works when I key use control copy then activate the script

WinWaitActive("Microsoft Excel - 0616timesheet")

Send("!est{ENTER}")

Send ("{TAB}")

Send ("!{TAB}")

ClipPut is used to write text to the clipboard and the parameter has to be text. See the help.

I think you want to have

Send("^c");copy highlighted text to the clipboard. Or Send("^{INS}")

Send("^v") ;paste the text somewhere else Or SEnd("+{INS}")

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

If you are going to interact with web pages... look at the _IE* functions in the help file. If you want the text on the web page only, then you could look at _IEAttach or _IECreate to create an object to the page you're currently view, or create an object of the page you want to go to. Then use something like _IEBodyReadText or possibly _IEDocReadText.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

ClipPut is used to write text to the clipboard and the parameter has to be text. See the help.

I think you want to have

Send("^c");copy highlighted text to the clipboard. Or Send("^{INS}")

Send("^v") ;paste the text somewhere else Or SEnd("+{INS}")

Thanks for your help Send("^c"); works but only within the same file

When the Autoit application starts the highlight looses focus and it does not capture the text from the web page.

I will try figure a way around that issue.

TC

Share this post


Link to post
Share on other sites

If you are going to interact with web pages... look at the _IE* functions in the help file. If you want the text on the web page only, then you could look at _IEAttach or _IECreate to create an object to the page you're currently view, or create an object of the page you want to go to. Then use something like _IEBodyReadText or possibly _IEDocReadText.

Thanks for your help.

Have read the help files but think I had better "step away from the computer" and continue mechanically copying the text to the clipboard.

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