Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mail issue



Is there a way to check unread mails only? (instead of selecting them)

set unread_Messages to messages of mailbox "Online File Transfers" whose read status is false -- Obtain a list of 'unread' messages, in mailbox 'Online File Transfers'.


Is there a way of putting the retrieved file in a specific location?

move i to mailbox "Read"

Can this be simplified?

<script>
global myMessages
...
end tell
</script>
--

tell application "Mail" launch -- or 'activate'.

set unread_Messages to messages of mailbox "Online File Transfers" whose read status is false -- Obtain a list of 'unread' messages.

repeat with i in unread_Messages -- Cycle through the 'unread' messages.
set tParagraphs to paragraphs of (content of i) -- Obtain paragraphs of 'unread' message.


repeat with j from 1 to ((count tParagraphs) - 1) -- Cycle through the paragraphs of the 'unread' message.
-- Determine if current and next paragrah meet certain criteria.
if (((((item j of tParagraphs) as string) contains "Download the file using the link below:") and (((item (j + 1) of tParagraphs) as string) begins with "http://";))) then tell application "Safari" to make new document with properties {URL:(item (j + 1) of tParagraphs)} -- Open respective web page.
end repeat


move i to mailbox "Read" -- Move the 'unread' message to another folder. 'Read' in this example.
end repeat
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users


This email sent to email@hidden
References: 
 >mail issue (From: dstevens <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.