You think you’ve got problems. My iMac seems to be working OK but I can’t get onto the internet with wny of the Apple software on my Macbook Pro. That’s Safari, Mail, App Store, iTunes. Emails come in in Mail but there’s no content ot them. I can’t even read old mails. Fireworks and Thunderbird work fine and Network Diagnostics tell me that everything is fine.
Update on the above.
Safari and App Store have decide to start working for some reason, I can send emails with Mail but still can’t read my mails so hopefully things will improve.
Yes, looks to be the case. It could be either a change in the AppleScript support of Mail, or alternatively it could be just a plain bug in Mail.
@ccstone - do you have a Sierra Mac handy that you could check the AppleScript for sending a Mail message? You’re much better at AppleScript than I am.
Otherwise I’ll try to delve in to the AppleScript to determine if the issue is a change or a bug in Mail.
If Automator works, why not (at least as an interim solution) create an Automator workflow and run it from Keyboard Maestro with the Execute an Automator Workflow action?
I did a little bit of testing, and the visible flag for mail is decidedly different AppleScript for Sierra.
Visible:true sends the message when the send AppleScript command is used.
Visible:false places the message in the Drafts folder with the send AppleScript command is used. No message is sent.
The messages appear in the Sent or Drafts folder and are not opened in either case for the user (as they were in prior system versions, when the visible:true flag was used).
I think an AppleScript could be written which would imitate the opening of the email when dropped in the Drafts folder. This would simulate the “old” behavior of AppleScript for Mail.
Ok, here is code to get the most recent message in the Draft folder and open it:
`
tell application "Mail"
set draftMessages to every message in drafts mailbox
set draftMessagesID to {}
# go through each draft message
repeat with draftMessage in draftMessages
set draftMessageID to id of draftMessage as string
copy draftMessageID to the end of draftMessagesID
end repeat
# go through the list of draft message ids and process the most recent item
if (count of the draftMessagesID) is greater than 0 then
set sortedDraftMessagesID to the reverse of my sortAlphabetically(the draftMessagesID)
# get only the first item, as this is the most recent
set lastDraftMessageID to first item of sortedDraftMessagesID as integer
# get the most recent draft message
set theMessage to first message of drafts mailbox whose id is lastDraftMessageID
tell theMessage
open
end tell
end if
end tell
# handler to sort a list alphabetically
on sortAlphabetically(theList)
set the indexList to {}
set the sortedList to {}
repeat (the number of items in theList) times
set the lowItem to ""
repeat with i from 1 to (number of items in theList)
if i is not in the indexList then
set thisItem to item i of theList as string
if the lowItem is "" then
set the lowItem to thisItem
set the lowItemIndex to i
else if thisItem comes before the lowItem then
set the lowItem to thisItem
set the lowItemIndex to i
end if
end if
end repeat
set the end of sortedList to the lowItem
set the end of the indexList to the lowItemIndex
end repeat
return the sortedList
end sortAlphabetically