Page 1 of 1

Mail search code

Posted: Sat Sep 23, 2023 2:47 am
by mcelvain
Is there LiveCode script to search through several years of mail ?

It would have to have built in pauses in order to allow server upload batches..,

Re: Mail search code

Posted: Sat Sep 23, 2023 9:05 am
by FourthWorld
What format is it in? What is the role of the server? How frequently and flexibly would you be doing these searches? What output do you want?

Re: Mail search code

Posted: Tue Sep 26, 2023 2:56 pm
by mcelvain
Thanks for your response, Richard !

[What format is it in?]
=Macintosh "Mail" program

[What is the role of the server?]
=script would prompt "Mail" to keep "checking mail" until month/year,
performing keyword search, returning enclosed document


[How frequently and flexibly would you be doing these searches?]
=once


[What output do you want?]
=TextWrangler text file

Re: Mail search code

Posted: Tue Sep 26, 2023 3:50 pm
by FourthWorld
Since the task is a one-off, it may not be worth the effort to write a parser/query engine for Apple's mail format.

Does Mail support AppleScript? If so this might be a shorter task than originally envisioned.

Re: Mail search code

Posted: Tue Sep 26, 2023 5:35 pm
by stam
This is in no way a complete answer, but may provide a useful starting point: https://apple.stackexchange.com/questio ... by-subject

Although if it’s a 1-off, why program a solution instead of using built in tools?

Re: Mail search code

Posted: Tue Sep 26, 2023 5:54 pm
by dunbarx
why program a solution instead of using built in tools?
Stam, do you mean built into Mac's Mail client?

If so, then I think the OP wanted to have LC do that for him, and have the results brand spanking ready for further processing.

If not (that is, there is something in LC) what did you mean?

Craig

Re: Mail search code

Posted: Tue Sep 26, 2023 6:02 pm
by dunbarx
I use the Mac mail client.

One can sort by several criteria, like the date, and it would take little effort to identify a group of mails sorted that way. But I do not see a way to export such a group into some form of text file. I see you can export as PDF, but then each thread is placed into a separate file somewhere.

Craig

Re: Mail search code

Posted: Tue Sep 26, 2023 6:26 pm
by stam
dunbarx wrote:
Tue Sep 26, 2023 5:54 pm
why program a solution instead of using built in tools?
Stam, do you mean built into Mac's Mail client?

If so, then I think the OP wanted to have LC do that for him, and have the results brand spanking ready for further processing.

If not (that is, there is something in LC) what did you mean?

Craig
I meant if it’s a 1-off it’s usually much more work to automate it via code rather than go low-tech as it were.

If on the other hand it’s something that may be used repeatedly then coding a solution makes more sense. And as Richard says probably something that can be done with AppleScript, either inside livecode or some app like Automator.

Come to think of it, wouldn’t Automator be a better choice?