You can't get here from there [was Eudora move to front]
You can't get here from there [was Eudora move to front]
- Subject: You can't get here from there [was Eudora move to front]
- From: Devon and Cornwall <email@hidden>
- Date: Sat, 24 Feb 2001 23:37:34 -0800
We've asked, searched the archives (1999, 2000, 2001), scoured JD's
site and looked in the dictionary (it lies). Not a single example of
move to beginning of a mailbox.
The script is going to open a mailbox (a MIME version of this
digest), archive every message to FileMaker, put the message the
digest was attached to into its attachment as the first message and
move the mailbox to a particular folder.
The following (longish) script manages to do all that - It is so
slow. Can I do *anything to significantly speed it up?
Devon and Cornwall
--How do you feel about interpretive dance?
tell application "Eudora" to set EudorTrashFile to file of mailbox 3
tell application "Finder" to delete EudorTrashFile
open for access EudorTrashFile
close access EudorTrashFile
tell application "FileMaker Pro"
activate
if not (exists database "AppleScript Users Digests") then
open alias "Disk:Folder:AppleScript Users Digests"
end if
go to database "AppleScript Users Digests"
end tell
tell application "Eudora"
activate
set digestCnt to count of every message of mailbox "AS Users Digest"
end tell
repeat with i from 1 to digestCnt
tell application "Eudora"
subject of first message of mailbox "AS Users Digest"
result's text items 27 thru 36 as text
"AS-users digest, " & result returning issue
tell first message of mailbox "AS Users Digest"
set thisAttachment to attachment 1
set thisAttachment to thisAttachment as alias
end tell
move first message of mailbox "AS Users Digest" to (end of mailbox "Trash")
end tell
tell application "Finder"
move thisAttachment to folder "Disk:Folder:"
set the name of thisAttachment to issue
open thisAttachment
end tell
tell application "Eudora"
activate
set currentMailbox to name of window 1
set CurDigestsMsgCnt to count of every message of mailbox currentMailbox
end tell
repeat with i from 1 to CurDigestsMsgCnt
tell application "Eudora"
tell first message of mailbox currentMailbox
set {fromField, theSubject, sendersDate, relativeDate, messageBody} to (Opt-L)
{field "From", its subject, universal seconds, field "Date", body}
end tell
move first message of mailbox currentMailbox to (end of mailbox "Trash")
end tell
set trimFromFieldName to text 7 through -1 of fromField as string
if the first word of theSubject is "Re" then set theSubject to (Opt-L)
(text 5 thru -1 of theSubject) as string
set trimRelativeDate to text 7 through -1 of relativeDate as string
--French Vanilla method
copy sendersDate to b
set month of b to January
set x to 1 + ((sendersDate - b + 1314864) div 2629728)
set shortMessageDate to (x as text) & "/" & day of sendersDate & "/" & (Opt-L)
text -4 thru -1 of (year of sendersDate as text)
set messageTime to the time string of sendersDate
set tempDataList to {trimFromFieldName, theSubject, trimRelativeDate, messageBody, (Opt-L)
shortMessageDate, messageTime}
tell application "FileMaker Pro"
set newRec to (create new record with data tempDataList (Opt-L)
at end of layout 1 of database 1)
end tell
end repeat
repeat with i from 1 to (CurDigestsMsgCnt + 1)
tell application "Eudora" to move first message of mailbox "Trash" to (end of mailbox currentMailbox)
end repeat
tell application "Eudora" to close window 1
end repeat
tell application "FileMaker Pro" to go to newRec