Re: Entourage question
Re: Entourage question
- Subject: Re: Entourage question
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 26 Aug 2002 10:15:23 -0700
On 8/26/02 5:20 AM, "John Delacour" <email@hidden> wrote:
>
At 12:57 pm +0200 26/8/02, Gvran Ehn wrote:
>
> I'm having problems when saving an attachment from Entourage.
>
> Does anyone know a working syntax for doing this?
>
> This I have tried but it does not work:
>
> save (attachment "myfile.jpg" of message id 7 of folder
>
> "testfolder") in (pathtodesktopfolder & "myfile.jpg" as string)
>
>
>
>
>
"in (pathtodesktopfolder & "myfile.jpg" as string)",
>
>
which means nothing, should probably be something like
>
>
file ("" & (path to desktop folder) & "myfile.jpg")
>
>
but I can't test it.
>
No, that's wrong John. It turns out that 'save' in the Standard Suite
_always_ allowed or required the string path name, NOT 'alias' as the Suite
says and which never worked, nor file specification, which did work in most
cases, and it was Jon's Commands or Akua which was performing the coercion
in the opposite direction to what we thought! (This was the very "Pallas
Athena" case, if you recall.) It is exposed particularly in the case of
Entourage and Outlook Express, because their own 'file' keywords prevent the
word 'file' being used, but the string path would work even without Jon's or
Akua. I used to get up to all sorts of convolutions until I discovered the
truth. It has been confirmed by Chris and by the release notes for
AppleScript 1.6 when they changed the 'file' underpinnings from file
specification to fileURL. The data type required in AppleScript for 'save'
became 'string' officially at that point, and the file system does the
coercion to fileURL. The Standard Suite for all Cocoa apps, and now for
Entourage (at my urging) correctly stated 'string' as the data type needed
from AS 1.6 onwards. [The 'string' in question is 'international string'.].
And now in AS 1.9 (maybe in 1.8.3 too, I forget) it states 'Unicode text'.
Take a look at TextEdit's dictionary, for example, and you'll see. Then try
it in OS X, where Jon's doesn't pertain, with 'file' and without. In
particular, in Entourage, where you cannot use 'file' you MUST use the
string or Unicode path.
In this particular case, the syntax must be wrong in that the variable may
not represent the desktop correctly and/or the parentheses are incorrect.
"in (pathtodesktopfolder & "myfile.jpg" as string)",
should be
in ((path to desktop as string) & "myfile.jpg)
but will only work, I'd guess, if the attachment really is a JPEG graphic.
it might be better to omit the extension and see what results first.
--
Paul Berkowitz
_______________________________________________
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.