• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: saving mails...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: saving mails... (From: Jean-Christophe Helary via AppleScript-Users <email@hidden>)
 >Re: saving mails... (From: Yvan KOENIG via AppleScript-Users <email@hidden>)
 >Re: saving mails... (From: Jean-Christophe Helary via AppleScript-Users <email@hidden>)
 >Re: saving mails... (From: Shane Stanley via AppleScript-Users <email@hidden>)
 >Re: saving mails... (From: Jean-Christophe Helary via AppleScript-Users <email@hidden>)
 >Re: saving mails... (From: Yvan KOENIG via AppleScript-Users <email@hidden>)

  • Prev by Date: Re: saving mails...
  • Next by Date: Re: saving mails...
  • Previous by thread: Re: saving mails...
  • Next by thread: Re: saving mails...
  • Index(es):
    • Date
    • Thread