Quantcast
Channel: DEVONtechnologies Community - Latest posts
Viewing all articles
Browse latest Browse all 16959

Same mail with different mail ids in mail.app when running Apple Scripts from DEVONthink 3

$
0
0

Did you check the source of the selected message? Also, instead of comparing the file extension to pdf, I’d go for the MIME-type.

And then you could, of course, find the two messages with a script like this (JavaScript, I don’t do AS):

(() => {
  const app = Application("Mail");
  const mailbox = app.accounts['Bru6'].mailboxes['INBOX'];
  [247497,246889].forEach(messageID => {
    const message = mailbox.messages.whose({id: messageID})[0];
    console.log(`${messageID}: ${message.subject()} from ${message.sender()} at ${message.dateReceived()}`);
  })
})()

And here’s the AS equivalent

tell application "Mail"
	set mbox to mailbox "INBOX" of account "DEVONthink"
	set msgIDs to {29870, 29891}
	repeat with mid in msgIDs
		set msg to item 1 of (messages of mbox whose id is mid)
		log (mid & ": " & subject of msg & " from " & sender of msg & " at " & date received of msg) as string
	end repeat
end tell

Viewing all articles
Browse latest Browse all 16959

Trending Articles