Hello,

As promised, I have written the script that Jonathan Mozen requested. Please 
note, I have only run this twice and only on a Yosemite system, so no promises. 
I put in a little more documentation than most of what I have published, but it 
could use more.

I don’t always get to read MacVisionaries, so write me directly if you need 
support and I will try.
The script sstarts with the use line and ends with “end run” 

————————-
use Mail : application id "com.apple.mail"

-- This set of statements is all you should need to adjust.
-- this will change the columns for the Family Mailbox of the Google account 
and the Inbox 
to CorrectColumns()
        set mb to mailbox "Family" of account "Google"
        set col to {attachments column, message status column, subject column, 
from column, date received column}
        AdjustMailColumns for mb into col
        set mb to mailbox inbox
        AdjustMailColumns for mb into col
        
end CorrectColumns


-- The real meat of the script is below.
--This function takes a folder and a list of columns and attempts to set the 
columns up.
-- If no message viewer is available create one.

on AdjustMailColumns for myBox into ColumnList
        try
                set myViewer to message viewer 1
                set myWindow to window of myViewer
                set myWindow's index to 1
                
        on error
                set myViewer to make new message viewer
        end try
        set selected mailboxes of myViewer to {myBox}
        set the visible columns of myViewer to ColumnList
end AdjustMailColumns
-- This will make the application specified move to the front.
-- no errors or specific messages are generated on failure.
on MoveToFront(AppName)
        try
                activate application AppName
                tell application "System Events"
                        set frontmost of process AppName to true
                end tell
        end try
end MoveToFront

on run {}
        MoveToFront("Mail")
        CorrectColumns
end run

Best wishes,

Jonathan



-- 
The following information is important for all members of the Mac Visionaries 
list.

If you have any questions or concerns about the running of this list, or if you 
feel that a member's post is inappropriate, please contact the owners or 
moderators directly rather than posting on the list itself.

Your Mac Visionaries list moderator is Mark Taylor and your owner is Cara Quinn 
- you can reach Cara at caraqu...@caraquinn.com

The archives for this list can be searched at:
http://www.mail-archive.com/macvisionaries@googlegroups.com/
--- 
You received this message because you are subscribed to the Google Groups 
"MacVisionaries" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to macvisionaries+unsubscr...@googlegroups.com.
To post to this group, send email to macvisionaries@googlegroups.com.
Visit this group at https://groups.google.com/group/macvisionaries.
For more options, visit https://groups.google.com/d/optout.

Reply via email to