Jump to content

Creating a "smart" copy-script

Recommended Posts

Hi there, I want to create some sort of a text copy-script.

But the problem is that the text is in multiple pages (PAGE-DOWN) and is variable in lenght.

But what I was thinking is maybe making some compare between the last 2 pages I copied and extract the difference in some way, and if the outcome is equal the script must stop.

Is there a way of doing this or does anyone have a better idea???

Anything is welcome... :D

Link to post
Share on other sites

Doesn't Ctrl+a select all text in this program ?

No, it doesn't and thats the whole problem.

(some sort of DOS under windows sales database)

I've created a script that I tell how many PAGEDOWN's it has to copy.

But I really like to set it at work and that it recognizes the end of the DATA. :D

Link to post
Share on other sites

Without knowing more about the application, how you select text, how it pages down if the last page doesn't excatally line up with the size of the window, etc, I will be limited in what I can suggest. However, here are some ideas:

  • I am assuming you can copy text from this app in some way. If not, this should be your first priority. From your first post, I gathered that you could copy one page of text at at time.
  • You can read the clipboard entry into an array for that page. Each array element could be a line.
  • To validate that the page you are on is not the last page, you can compare the last line of your clipboard entry (everything after the last @LF or @CR depending) or read it into a temporary array to get that info. Then, make sure it does not equal any of the last X lines, where X is the most lines you can have on a page. This will alert you to the condition that the last line coppied matches on you already have.
  • You'll also need to test for lines you have already inserted. Consider the following case: you have a document that is 1.5 pages long. The first page is coppied properly, and inserted into your array, so you page down. If the 2nd page "centers" itself such that you not only see the last half a page, but also the 2nd half of the first page, then a "page copy" (see bullet 1) will also gather the last of the former page. To prevent this, you'd have to see what parts of that copy you already have, if any, and avoid entering it into your array.
Hopefully at least something on that list was useful to you.

Typo edit

Edited by pekster

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to post
Share on other sites

This option with the array's looks like something I can use, but I am not familiar with this type of scripting.

Do you have a little example wich I can take and go experiment from there?

PS: This copied text is about 14 lines at a time, is that a problem?

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...