Re: saving mails...
Re: saving mails...
- Subject: Re: saving mails...
- From: Yvan KOENIG via AppleScript-Users <email@hidden>
- Date: Tue, 19 May 2020 08:34:48 +0200
Maybe this brute force attempt may help.
set AppleScript's text item delimiters to {""}
tell application "Mail"
set _sel to selection
if length of _sel = 1 then
set _msg to item 1 of _sel
else
error "Too many messages selected."
end if
# Use account to find mail-folder in attempt to be compatible back to
Snow Leopard.
set acnt1Dir to (account directory of account 1) as string
set {oldTIDS, AppleScript's text item delimiters} to {AppleScript's
text item delimiters, ":"}
set mailFolderPath to POSIX path of (text items 1 thru -3 of acnt1Dir
as string)
set AppleScript's text item delimiters to oldTIDS
tell _msg
-- set mbxName to name of its mailbox
set mID to its id
end tell
end tell
# Find email
set shCMD to "mdfind -onlyin " & mailFolderPath & " 'kMDItemFSName == \"" & mID
& ".emlx\"cd'"
set emlFile to do shell script shCMD
if emlFile = {} then -- maybe there is some attachment, try to search the
alternate name
set shCMD to "mdfind -onlyin " & mailFolderPath & " 'kMDItemFSName ==
\"" & mID & ".partial.emlx\"cd'"
set emlFile to do shell script shCMD
end if
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mardi 19
mai 2020 08:34:24
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden