Re: Newbie needing help
Re: Newbie needing help
- Subject: Re: Newbie needing help
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 21 Jan 2001 01:08:51 -0800
On 1/20/01 10:08 PM, "Bernard Azancot" <email@hidden> wrote:
>
I would like to write a script:
>
>
- launching M$ OutlookExpress (easy ;-))
>
- U/L and D/L my mail
>
- disconnecting when work is done.
>
>
I presume many of you use such a script.
>
Hints to help me ?
>
>
Thx in advance.
The main hint is to look in the Outlook Express dictionary. the two things
you ask for are among the very simplest commands, so I wonder if you know
where and what the Dictionary is. Every application has a dictionary of all
the terms -- events (verbs), classes (nouns) and properties of those classes
(usually nouns dependant on the classes) -- which govern what can be
scripted in the application. Use the File-->Dictionary menu item in Script
Editor or another editor like Smile to navigate to the application's file,
and you will see all of them. Many of the most important application
elements and properties are contained in the 'application' class in the
Standard Suite rather than within the application's own suite, so don't omit
that.
If you have already looked at the Dictionary for Outlook Express you will
have seen :
send : Send e-mail messages
send [ a list of message] -- the message(s) to send, or none to send all
queued messages
[sending later boolean] -- Should the message just be queued to be
sent later (defaults to false)?
"none at all to send queued messages" means that to send (what you called
U/L) the messages in your outbox just write
tell application "Outlook Express"
send
end tell
You can send an open draft window (new message) by
send window 1
To send a specific saved outgoing message you need a way to identify which
message.
To download use the event
connect to : Connect to account (POP, IMAP, or news)
connect to a list of reference -- the account(s) to connect to
You can just write;
connect to every POP account -- or IMAP account
to do the equivalent of "Receive All".
If by "disconnect when done" you mean disconnect from the Internet, if you
are using an OS 8.5 to 9.0.4 , but NOT 9.1, you can do use the scripting
addition 'RA disconnect' after first checking downloading has finished:
repeat while connection in progress -- application property
delay 1 -- Standard Additions, means wait 1 second
end repeat
-- it's now over, so
RA disconnect
(Better than 'delay' might be using the Sleep Commands scripting addition or
'pause for' in Akua Sweets additions, both available at
http://www.osaxen.com if you wanted to do anything else while the script is
running. But since you're planning to disconnect at the end, that wouldn't
apply here, so 'delay' is OK.)
If you're on OS 9.1 there are new complications and a bug which you can read
about if you look over the posts on this list for the past three days,
particularly Chris Stone's 'MacOS 9.1 Network Setup Scripting & RA Status'
yesterday morning (Jan 20, that is). Also on OS 9.1 , to get 'delay' from
Standard Additions to work, you also have to make sure you haven't disabled
all the Security extensions.
Hope this helps.
--
Paul Berkowitz