Re: Saving an attachment in Outlook Express
Re: Saving an attachment in Outlook Express
- Subject: Re: Saving an attachment in Outlook Express
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 17 Jul 2001 18:06:45 -0700
On 7/17/01 5:38 PM, "Ken Grimm" <email@hidden> wrote:
>
OE's dict says this about the SAVE command:
>
>
save : Save an object
>
save reference -- the object to save
>
[in alias] -- the file in which to save the object
>
[as type class] -- the file type of the document in which to save
>
the data
>
>
>
The line that worked does not use an alias, as seemed to be required in
the
>
dictionary. Because of the "hint" given, I tried many variations of an
>
"alias" syntax, but none worked.
>
>
This example underscores a recurring frustration with me and scripting --
>
the quality of the dictionary. From the "save" verbiage from the OE
>
dictionary above, I have a hard time believing I'm the only one that would
>
have a problem with coming up with code that works. The working code does
>
not specify a file, but a folder -- again, seeming to contradict the
>
explanation of "[in alias]".
>
>
What the heck am I missing, or is this just common experience and I just
>
have to get used to dictionary frustration as a part of scripting?
>
>
Gurus and others, if you can give me some insight on how to interpret a
>
dictionary better to make me a more efficient scripter, I am listening.
>
I wrote in about this only a week or so ago. What always works is the
string version of a file specification for the file-to-be-created (see
below) probably because (I'm surmising) OE's 'save' command contains a
string-to-file-specification coercion. In many other apps you'd use
save MyAttachment in file "Macintosh HD:My Picts:File Name"
but you can't do that in OE because OE has its own 'file' application
keyword which conflicts with the AS 'file' keyword.
I'm still finding it hard to believe that you've got this to work:
save MyAttachment in "Macintosh HD:My Picts:"
i.e. Saving in the folder (as string) , not in the file specification of the
file-to-be-created, as string:
set theName to name of MyAttachment
-- do a routine to check viability of theName (not too long, no colons,
file of that name doesn't already exist in that folder)
save MyAttachment in ("Macintosh HD:My Picts:" & theName)
If you have either or both of Akua Sweets and Jon's Commands in your
Scripting Additions folder, could you remove them both from System Folder,
RESTART YOUR COMPUTER, and then try your script again? I suspect you're
benefiting from an osax coercion, and that you may have to do this my way
when you don't have the osaxen.
If you don't have either osax, please say so. If you do have one or the
other of them installed, please try removing them, restarting your computer,
then running the script as you have it.
--
Paul Berkowitz