• 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: structured data storage?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: structured data storage?


  • Subject: Re: structured data storage?
  • From: "Michael P. Wilson" <email@hidden>
  • Date: Sat, 25 Jan 2003 12:10:01 -0500

See, this is what happens when I post a message while brainstorming and jacked up on diet mountain dew with no sleep. ;-)

What I want to do is only test new email messages as they come in. I have a total of about 20k messages with something pushing 150-200 a day across about 300 email addresses. Scanning the whole mailbox should be an extremely rare task at best.

The algorithm for testing timestamps against each other, parsing from text or generating to text is all no brainer monkey work.

It's also import to keep this all in AppleScript.

My actual quandry is in deciding where to store the data. I'm trying to decide between an external file with a bunch of addresses & date-times (record per line, pipe delimited?) and storing the data directly in the address book note field.

Thanks :)

- M


On Saturday, Jan 25, 2003, at 10:54 America/New_York, Philip Aker wrote:

On Thursday, January 23, 2003, at 07:53 AM, Michael P. Wilson wrote:

(I'm a 26 year veteran programmer, but AS is a really strange environment, even being a perl monk and a high-end C++ weenie.)

[...]

But I'm having a bit of trouble figuring out how to store these two tables. I don't want to rely on nonstandard software components...

I'm having a bit of trouble figuring out your request, but I believe you could do this effectively with a combination of an AppleScript and a Tcl script. In particular, the Tcl 'clock scan' command to convert the AppleScript dates to an 8 byte hex format and pump the address and the converted date into a Tcl list which can then be ordered with 'lsort -dict'. Then it's up to you to get the last ordered list item of the same address and compare. You can do all file I/O and use 'exec' in Tcl to utilize old unix chestnuts. It also occurs to me that since you're comfortable in C++, why not just write a tool to do the dirty work on the files and call that via 'do shell script'.

Maybe someone else would have a suggestion for speeding up the following Mail script:

set m_box to "Sent Messages"
set delim to quoted form of tab
tell application "Mail"
try
set acct to account 1
tell acct
tell mailbox m_box
repeat with m in messages
set reci to address of (to recipient of m) as string
set ds to date sent of m as string
do shell script "echo " & (reci & delim & ds) & " >> ~/Desktop/SentDates.txt"
end repeat
end tell
end tell
return true
on error
return false
end try
end tell


HTH,

Philip Aker
http://www.aker.ca




-
"Thus nature has no love for solitude, and always leans, as it were, on some support; and the sweetest support is found in the most intimate friendship." - Cicero

http://radio.weblogs.com/0108194/
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: structured data storage? (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: Error trapping
  • Next by Date: A different question (Was: Re: structured data storage?)
  • Previous by thread: Re: structured data storage?
  • Next by thread: A different question (Was: Re: structured data storage?)
  • Index(es):
    • Date
    • Thread