Worked like a charm.
Thanks!!
Justin
On Wednesday, February 8, 2006, at 08:55 PM, Marcus Jarrett wrote:
> On Wednesday, 8 February 2006, Justin Beek, [EMAIL PROTECTED],
> thoughtfully composed the following:
>
>> Is there a better way to get the names of attachments so that they are
>> returned more "readable" form. (I'd prefer that they be
>> comma-separated)
>> See an example script below and the difference between what is
>> collected and what is reported in the Event Log.
>>
>> Background: In our current workflow, all incoming mail gets the
>> attachments saved to a specific folder on the server and then the
>> message if forwarded, sans files, to another user. Having all the
>> attachment names running together is quite hard to read.
>>
>> Thanks,
>> Justin
>>
>>
>> Example Script:
>> try
>> tell application "PowerMail 5.2.3"
>> activate
>> set theMessages to the current messages
>> repeat with theMsg in theMessages
>> set origAttach to name of attachments of theMsg as list
>> display dialog "These files are attached: " &
>> origAttach & return
>> end repeat
>> end tell
>> end try
>>
>
> Your problem is that origAttach is a list. Applescript is coercing that
> list to a string, with the standard delimiters, that is "". Try this:
>
>
> set origAttach to name of attachments of theMsg as list
> set AppleScript's text item delimiters to ", "
> set origAttach to origAttach as string
> set AppleScript's text item delimiters to {""}
> display dialog "These files are attached: " & origAttach & return
>
>
> HTH,
>
> Marcus
> --
> Marcus Jarrett, Adelaide, South Australia.
>
> When we remember we are all mad, the mysteries disappear and life
> stands
> explained.
>
> -Mark Twain
>
>
>