• 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: Jean-Christophe Helary <email@hidden>
  • Date: Mon, 05 Feb 2018 14:32:55 +0900


> On Feb 5, 2018, at 9:15, Christopher Stone

> Trying to go back to my mail saving thing where I save as raw message but
> then can't reply to the mail when I open it...
>>
>> ...
>> and I can't make sense of what is *not* happening... myMail is supposed to
>> be a reference and save needs a reference. So what's wrong?
>
> Hey Jean-Christophe,
>
> To the best of my recollection this has never worked.

It does make me feel better. I seem to remember that a few months ago somebody
insisted here that I try to "save the message" as if it were obvious...

> It is beyond ridiculous to be unable to go straight from a message to it's
> file on-disk, but then Mail's sdef has several defects and omissions and
> needs some TLC.

:)

By the way, what I need to do is save a mail close to my job files so that when
I deliver the job I can just open that mail and reply to it.  If there is a
better way to keep a trace of that mail that does not imply saving it
physically, I'm fine too :)

> Finding it with Spotlight is slow in computer terms but reasonably acceptable
> in human terms.

Finding the way to accomplish that is pretty slow and not really acceptable in
human terms though :)

Thank you very much for your help.

Jean-Christophe

>
> ----------------------------------------------------------------
> # Auth: Christopher Stone <email@hidden>
> # dCre: 2012/07/18 05:51
> # dMod: 2018/02/04 17:56
> # Appl: Mail
> # Task: Find the disk file of the selected email message using Spotlight.
> # Libs: Uses only OSX components.
> # Test: Lion & Mountain Lion, Mavericks, Yosemite, Sierra
> # Tags: @Applescript, @Mail, @Find, @Disk, @File, @Selected, @Email,
> @Message, @Spotlight
> ----------------------------------------------------------------
>
> 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
>               set mSub to its subject
>       end tell
>
> end tell
>
> # Escape single quotes in subject for spotlight query string.
> if mSub contains "'" then
>       set mSub to REPL(mSub, "'", "'\"'\"'")
> end if
>
> # Find email
> set shCMD to "mdfind -onlyin " & mailFolderPath & " 'kMDItemDisplayName ==
> \"" & mSub & "\"cd && kMDItemFSName == \"" & mID & ".emlx\"cd'"
> set emlFile to do shell script shCMD
>
> ----------------------------------------------------------------
>
> --
> Take Care,
> Chris


Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune


 _______________________________________________
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

  • Follow-Ups:
    • Re: saving mails...
      • From: Christopher Stone <email@hidden>
References: 
 >saving mails... (From: Jean-Christophe Helary <email@hidden>)
 >Re: saving mails... (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: saving mails...
  • Next by Date: Re: How to set green color in Terminal.app to a specific color code?
  • Previous by thread: Re: saving mails...
  • Next by thread: Re: saving mails...
  • Index(es):
    • Date
    • Thread