The only way I know to do this is via AppleScript. I use the
script below which was posted in this group long ago. I do not
recall the original author of the script. After selecting a
message, the script gathers the remaining messages in the thread
then displays all of the messages in a new window where it is
easy to read them in order.
script follows
-----
(*
Based on "Make Thread Window" and "Script Frameworks".
*)
on run
set the_list to get_list()
set cl to count items of the_list
if cl = 0 then display dialog "No message was selected."
buttons "Close" default button 1 with icon 2
if cl > 1 then display dialog "This script only works on a
single message." buttons "Close" default button 1 with icon 2
if cl = 1 then my do_action(the_list)
end run
on do_action(the_message)
tell application "Mailsmith"
set myMsg to item 1 of the_message
set myBox to container of myMsg
set myTitle to thread title of myMsg
set myName to "Thread: " & myTitle as text
set myBounds to {425, 50, 1125, 760}
set myWin to make new mail list window with properties
{name:myName, bounds:myBounds} ¬
with data every message of myBox whose thread title
contains myTitle
sort myWin by time received sort direction reverse
end tell
end do_action
on get_list()
tell application "Mailsmith"
set retry to false
try
set m_list to get selection
set m_list to m_list as list
set m to item 1 of m_list
if class of m is not message then set retry to true
on error
set retry to true
end try
if retry then
set retry to false
try
set m_list to message of window 1 as list
on error errormsg
display dialog "This error occurred: " &
errormsg buttons {"Close"} default button 1 with icon stop
set retry to true
end try
end if
if retry then set m_list to {}
end tell
return m_list
end get_list
On 12/17/09, Charlie Garrison wrote:
>have a look at the attached scripts. Note, you will need to
>change the path to the "Properties" script within the "By
>Title" script
The ByTitle script reads “(path to application support folder
from user domain)”.
Should this path go to the
User/Library/ApplicationSupport/Mailsmith folder (where there is
no Scripts subfolder) or to
Applications/Mailsmith/Contents/Resources/Scripts? I’m
suspecting that the correct answer is the former and I will just
need to create a new directory for the scripts there, but as I
am a newbie to scripting, I’d prefer to be cautious and inquire.
Thanks
-Said
Correct, it's the former and you will need to create the Scripts
folder within User/Library/ApplicationSupport/Mailsmith (if it's
not already there). Note, you can also create sub-folders within
Scripts (which is what I do) and you can effect the sort order
in the Scripts menu by prefixing file names with 2 digits and
right parens. (That's why the file names I attached have numbers
in front.)
I suggest searching for "AppleScript" in the manual too. There
is lots of great info that will help get you started. Also, as
Jason said, if you get stuck then there are enough people on
this list that can help out.
On 16/12/09 at 6:25 PM -0800, Bill Rowe
<read...@sbcglobal.net> wrote:
>The only way I know to do this is via AppleScript. I use the
>script below which was posted in this group long ago. I do not
>recall the original author of the script. After selecting a
>message, the script gathers the remaining messages in the
>thread then displays all of the messages in a new window where
>it is easy to read them in order.
That's effectively the same one I posted yesterday, but the one
I sent is slightly more complicated since I use an external
'properties' file which contains details shared by all my "Show
Message" scripts. Eg. I have a script to show all messages 'by
author', 'unread', etc. And they all share the same properties.
I think Said might prefer your version since it doesn't involve
a separate 'properties' script.
Time to start comparing and delving.
-Said
Alas, even some of the simplest procedures cann be fraught with problems.
I tried Bills’ script and it worked great, except that it
left out the original post to the thread. So I tried Charlie’s
but it will not compile because I am doing something
syntactically wrong.
Starting with this:
property scriptPath : ((path to application support folder from
user domain) as string) & "Mailsmith:Scripts:15)Threads:99)Properties"
I wrote...
property scriptPath :((/Users/sn/Library/Application
Support/Mailsmith/Scripts) as string) & "Mailsmith:Scripts:15)Threads:99)Properties"
But I keep getting “expected expression” errors. I’ve
played with the parentheses and the pathname but cannot get the
script to compile from this very beginning. I’ve looked in
Google and the pdf Applescript literature for proper scriptpath
syntax and haven’t been able to dig up any leads.
Suggestions?
Many thanks
-Said
On 18/12/09 at 1:51 PM -0800, lumin...@gmail.com wrote:
>Starting with this:
>property scriptPath : ((path to application support folder from
>user domain) as string) & "Mailsmith:Scripts:15)Threads:99)Properties"
>
>I wrote...
>property scriptPath :((/Users/sn/Library/Application
>Support/Mailsmith/Scripts) as string) & "Mailsmith:Scripts:15)Threads:99)Properties"
>
>But I keep getting “expected expression” errors. I’ve
>played with the parentheses and the pathname but cannot get the
>script to compile from this very beginning. I’ve looked in
>Google and the pdf Applescript literature for proper scriptpath
>syntax and haven’t been able to dig up any leads.
First, you're not quoting the first part of your expression:
((/Users/sn/Library/Application Support/Mailsmith/Scripts) as string)
should be
(("/Users/sn/Library/Application Support/Mailsmith/Scripts") as string)
But if you're not using the 'path to' command, then no need to
make a complex expression, just make a simple string:
property scriptPath : "/Users/sn/Library/Application Support/Mailsmith/Scripts/15)Threads:99)Properties"
You also need to ensure that path is valid and actually points
to a file that exists at that location. You might be better off
starting with:
property scriptPath : "/Users/sn/Library/Application Support/Mailsmith/Scripts/Properties"
Then once you've got it working like that, then you can move it
to sub-folders, etc.
>I think Said might prefer your version since it doesn't involve
>a separate 'properties' script.
Well I tried Bill’s script and it works great. As long as I
invoke it while selecting the original post, then it performs
exactly as needed.
In the interest of getting my feet a little deeper into
Applescript, I’m hammering away at Charlie’s By Title
script. Thanks to his suggestion for using quotes to define
expressions (duh) the script compiles fine now, but it won’t
run without Mailsmith kicking up an Applescript error about
“bad name for file”.
property scriptPath : "/Users/sn/Library/Application Support/Mailsmith/Scripts/99)Properties.scpt"
I’ve tried this with and without the filename’s numbers,
parenthesis, suffix, etc. The file, “99)Properties.scpt” is
indeed located in the Scripts folder (otherwise it wouldn’t
appear in Mailsmith’s scripting menu, right?) and I’ve
quadruple-checked the path for spelling. Is there another
convention for pointing to this specific file that I am missing?
Thanks
-Said
On 21/12/09 at 8:50 AM -0800, lumin...@gmail.com wrote:
>property scriptPath : "/Users/sn/Library/Application Support/Mailsmith/Scripts/99)Properties.scpt"
>
>I’ve tried this with and without the filename’s numbers,
>parenthesis, suffix, etc. The file, “99)Properties.scpt” is
>indeed located in the Scripts folder (otherwise it wouldn’t
>appear in Mailsmith’s scripting menu, right?) and I’ve
>quadruple-checked the path for spelling. Is there another
>convention for pointing to this specific file that I am missing?
Open Terminal app and enter the following:
ls "/Users/sn/Library/Application Support/Mailsmith/Scripts/99)Properties.scpt"
Be sure to copy/paste the command to avoid typing errors. If the
command returns with the name of the Properties file then I
don't have any other suggestions (right now). If you get a "No
such file or directory" error then the path is not correct; fix
the path and try the script again.
>Open Terminal app and enter the following:
>
>ls "/Users/sn/Library/Application Support/Mailsmith/Scripts/99)Properties.scpt"
>
>Be sure to copy/paste the command to avoid typing errors. If
>the command returns with the name of the Properties file then I
>don't have any other suggestions (right now). If you get a "No
>such file or directory" error then the path is not correct; fix
>the path and try the script again.
Terminal returns the entire path verbatim, not just the file:
/Users/sn/Library/Application Support/Mailsmith/Scripts/99)Properties.scpt
I go up a directory and terminal lists all the scripts in the
folder, including
99)Properties.scpt
BTW I get the same error when running the script in Script Editor:
Mailsmith got an error: Bad name for file. /Users/sn/Library
/Application Support/Mailsmith/Scripts/99)Properties.scpt
Cheers
-Said