Jump to content

Requesting help: automate printing


Recommended Posts

Good day to all.

I'm apologizing in advance for being such a clueless newbie.

I have hundreds (or thousands) of email messages that I need to print out. Its a long story, but I have 10 years worth of eBay and PayPal messages that currently exist only in electronic form. Now I need them in paper form.

I already have my printer set to print on both sides of one sheet of paper. All of the information I need is on the first two pages of each message. Anything past the second page is superfluous.

In my DOS days, I used a program called SmartKey to do simple automation tasks. But - it doesn't know anything about Windows.

Here's what I need to do:

The task is tied to the [Tab] key. It doesn't do anything until the [Tab] key is pressed.

Make Eudora window active

Press [Ctrl] [p] to bring up the Print dialog box

Enter "2" into the Edit2 box (print pages 1-2)

Press [Enter] (actually start the print job)

Press [Ctrl] [Down Arrow] to go to the next message

Done. Wait for the next tab key press.

Here's what I've tried so far:

WinWaitActive("Eudora")

HotKeySet("{Tab}", "captureTab")

Func captureTab()

^p

ControlSend ("Print", "Edit2", "2", {ENTER})

^{DOWN}

EndFunc

Couple of notes:

1) I was going to make the Eudora window active before I pressed the [Tab] key.

2) I'd be happy if I could do this without having to press the tab key for each message. But I can't think of a way to stop the task when it has reached the last message in the mailbox.

Thanks in advance for any advice and suggestions.

dwayne

Link to comment
Share on other sites

Another kick at the cat:

WinWaitActive("Eudora")

HotKeySet("{TAB}", "captureTab")

Func captureTab()

Send("^p")

ControlSend("Print", "", "Edit2", "2")

Send("{ENTER}")

Send("^{DOWN}")

EndFunc

The above has lots of red in the editor and I don't know why. I'm trying to follow the examples in the help file but obviously I'm missing something fundamental.

Any guidance gratefully accepted.

Thanks!

dwayne

Link to comment
Share on other sites

Well, I've kinda got something working. I'd still appreciate pointers on how I might do it better

$i = 0

Do

WinActivate("Eudora", "")

Send("^p")

WinWaitActive("Print")

ControlSend("Print", "", "Edit2", "2")

Send("{ENTER}")

Sleep(500)

Send("^{DOWN}")

$i = $i + 1

Until $i = 317

Note that I change the above integer to match the number of messages in that particular mailbox.

dwayne

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