Re: Scripting E'rage
Re: Scripting E'rage
- Subject: Re: Scripting E'rage
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 27 Jan 2002 20:09:13 -0800
On 1/27/02 4:25 PM, "Stephen Swift" <email@hidden> wrote:
>
This is probably something small I've skipped over in haste, but for the
>
life of me I can't get E'rage (2001 on Mac OS 9) to save my custom views.
>
>
Manually, I drag my custom view (Mail Received Today) to the desktop and it
>
saves it as a MS E'rage document. When I want to view the mail I received
>
for that day I just double click the file and E'rage imports the mail into a
>
new folder.
>
>
How do I save a custom view using AppleScript?
>
>
What I've tried:
>
>
set blah to new file
>
tell application "Microsoft Entourage"
>
save folder " Other" in blah
>
end tell
>
--works great!
>
>
set blah to new file
>
tell application "Microsoft Entourage"
>
save custom view "Messages Received Today" in blah
>
end tell
>
--file is empty (0k) and no messages appear on import
>
>
It works just fine in Entourage X. I'll try it in 2001 a little later.
There's an error (which is actually Apple's fault, not Entourage's) in the
Standard Suite definition of 'save', repeated in many apps. it says that
that class of the parameter for 'in' is alias, but it's not. In OS 7/8/9,
it's 'file specification' , but you can't use 'file' with Entourage or OE,
because it's also an app keyword with a different meaning. But there's a
great AppleScript coercion from 'string' (the string filepath), which is now
official in OS X, but works right in OS 7/8/9 as well.
You just say 'blah'. your problem is with 'blah'. You might be using the
filePath or alias form of the containing folder. You should not: you should
use the string filePath for the file-to-be itself. First you have to assign
it a name, usually named for the object (custom view) you're exporting. You
should first use a routine for checking that there is no other file of the
same name already there, no colons, and shorter than 32 characters (well, it
should work OK in OS 9 even wit long file names). Skipping that, you want to
do this:
set fileSpec to (path to desktop as string) & "Mail Received Today"
tell application "Microsoft Entourage"
save custom view "Mail Received Today" in fileSpec
end tell
Obviously you can use any other filePath you want in any folder on your
disk, in this format:
set fileSpec to "Macintosh Hard Disk:A Folder:Another Folder:Mail
Received Today"
This works perfectly in Entourage X. Are you sure it doesn't in 2001?
In Entourage X, you can also import the mbox files back into Entourage by
script, BTW, with the new 'import' command.
--
Paul Berkowitz