Re: stuck using Outlook 2001
Re: stuck using Outlook 2001
- Subject: Re: stuck using Outlook 2001
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 16 Dec 2003 14:49:51 -0800
Actually, the same "other, better AppleScriptable apps" use a 'with
properties' record (not list) only with the 'make' event from the Standard
Suite, because 'make' specifies a 'with properties' parameter. It takes an
object (an instance of a class defined in the dictionary) as its direct
object, and lets you fill up all the properties that belong to the
dictionary definition of that class in the 'with properties' record. Those
very same "other, better AppleScriptable apps" use exactly the same format
as Outlook does when they use most of their other commands which have
parameters, since most parameters of most events take just a string, or a
single reference, or an application constant, or a boolean, just like the
command Outlook below.
For example:
tell application "Tex-Edit Plus"
replace document 1 looking for "smart" replacing with "dumb" with cases
matching and whole words matching without grep and global replacing
end tell
No records to be seen there. (Well, I would have included a couple but I
can't figure out how to get 'styles' to work.)
So the real reason why Outlook isn't any good is that it has such a skimpy
Dictionary. Of course apps should have a proper Object Model - with objects
- and then use 'make', not a proprietary event such as CreateMail. But
given as how that's the _only_ term in the dictionary it really hardly
matters - I can see why they didn't bother creating a 'message' class if all
you were going to be able to do was send it. In particular, if they created
the message class, they'd have to let you change its properties or make
every single one read only [r/o], they have to work out what to do with
received messages, and before you know it they'd have a real scriptable app.
I'm certainly not disagreeing with the description of Outlook as badly
scripted - of course it is - it's barely scriptable at all. But not because
it strings command parameters and their values together without punctuation:
that's how AppleScript syntax works, aside form the 'with properties'
parameter for 'make' and any other defined as a record. Personally I find it
very irritating of AppleScript. It works well when the parameters are
booleans (and thus transmogrified by the compiler to 'with' and 'without'):
replace document 1 with cases matching and whole words matching without
grep and global replacing
and also OK when the values for the parameters are strings or numbers:
replace document 1 looking for "smart" replacing with "dumb"
That one is particularly good because the implementers used English
prepositions ('for', 'with') as part of the parameters. It really doesn't
read well with application constants (enumerations) as the values following
straight on from their parameters without prepositions or punctuation.
--
Paul Berkowitz
>
From: Dennis Cox <email@hidden>
>
Date: Tue, 16 Dec 2003 14:58:45 -0600
>
To: <email@hidden>
>
Subject: RE: stuck using Outlook 2001
>
>
Outlook doesn't use a property list like other, better AppleScriptable apps,
>
you just list the parts by name with the string that will appear in the
>
respective field, no commas, no brackets, no colons. And I can't seem to get
>
it to work without "without Display" at the end.
>
>
CreateMail Subject subjectstring Body bodystring Recipients recipientstring
>
without Display
>
>
Dennis Cox
>
>
> ----------
>
> From: David DuBois
>
> Reply To: David DuBois
>
> Sent: Tuesday, December 16, 2003 11:25 AM
>
> To: email@hidden
>
> Subject: stuck using Outlook 2001
>
>
>
> I am trying to write a simple script to automate some email. Although
>
> Outlook 2001 has very limited scripting support, it should do what I would
>
> like it to do. What I have (and doesn't work) is:
>
>
>
> tell application "Microsoft Outlook"
>
> set mySubject to "Test Message" as string
>
> set myBody to "Some text goes here: " as string
>
> CreateMail {|recipients|:"email@hidden",
>
> |subject|:mySubject, |body|:myBody}
>
> end tell
>
>
>
> It will create a new message, but doesn't put in the recipents or subject
>
> or body of the message.
>
>
>
> Can anyone show me what I did wrong? Also, I would like to add a couple of
>
> hard returns in my body type after the "Some text goes here:"
>
>
>
> Thanks,
>
> David
>
> _______________________________________________
>
> applescript-users mailing list | email@hidden
>
> Help/Unsubscribe/Archives:
>
> http://www.lists.apple.com/mailman/listinfo/applescript-users
>
> Do not post admin requests to the list. They will be ignored.
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.