Working on BBS

Here’s a weird one… I am trying to do some tricks with Eudora – trying to imbed a reference to a particular message into an applescript, so that I can call it up from another program.

So, I can get the message id like so:

tell application "Eudora"
set theID to the id of message 0
end tell

and I can get a reference to that message’s containing “path” like so:

tell application "Eudora"
set theRef to the mailbox of message 0
end tell

but I can’t seem to format a string that would read something like: message 12345 of mailbox “In” of mail folder “” of applcation “Eudora”, which is exactly what I’d like.

Eudora tells me that it can’t convert the reference into a string. What would the more savvy do in a situation like this?

Thanks a lot -
/jj

Maybe this will work:

tell application "Eudora"
	set {mbox, id_} to {mailbox, id} of message ""
	set mref to a reference to message id id_ of mbox
end tell

--> message id 1.15002015E+9 of mailbox "In" of mail folder "" of application "Eudora"

– Rob

I think you’re trying to do the wrong thing.

The reference ‘message ID xxxx of mailbox y of mail folder “” of application “Eudora”’ is AppleScript’s human representation of the object in question - that is, that’s how it shows the object to us poor dumb humans.

Even if you could convert it to a string (which you can do by the code shown below) that won’t do what you want. What you’d have is a string which cannot then be converted back to a message. You’d be saying something like:

tell application “Eudora”
set someMsg to “message 12345 of mailbox “In” of mail folder “” of application “Eudora””
end tell

at this point, someMsg is a string object - just a string of characters. Nothing more, nothing less, but certainly not a pointer to the actual message. It might as well be the string ‘fred’ for what difference it makes.

If you’re trying to pass the message to another part of your script, just store the message itself:

set myMessage to message 12345

No matter where you go with your script, myMessage will hold everything you need to get back to this message at a later date.

To get the string you asked for, just:


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]
but like I said, this is almost useless.

You’re right – it’s fairly useless. However, this works nicely:

tell application "Eudora"
	set msgID to the id of message 0
	set mbox to (mailbox of message 0)
set mboxname to name of mbox -- this won't work except like this!
end tell

then, i can get back to the message with


tell application "Eudora"
open message id (msgID) of mailbox mboxname
end tell

thanks for your help!
jb