Mail search code

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
mcelvain
Posts: 58
Joined: Sat Apr 29, 2023 10:13 pm

Mail search code

Post by mcelvain » Sat Sep 23, 2023 2:47 am

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..,

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9857
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Mail search code

Post by FourthWorld » Sat Sep 23, 2023 9:05 am

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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

mcelvain
Posts: 58
Joined: Sat Apr 29, 2023 10:13 pm

Re: Mail search code

Post by mcelvain » Tue Sep 26, 2023 2:56 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9857
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Mail search code

Post by FourthWorld » Tue Sep 26, 2023 3:50 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

stam
Posts: 2758
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Mail search code

Post by stam » Tue Sep 26, 2023 5:35 pm

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?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9752
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Mail search code

Post by dunbarx » 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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9752
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Mail search code

Post by dunbarx » Tue Sep 26, 2023 6:02 pm

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

stam
Posts: 2758
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Mail search code

Post by stam » Tue Sep 26, 2023 6:26 pm

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?

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”