Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A script to selectively enable accounts in Mail Apps
When I go on vacation, I change the accounts that are automatically checked by Mail.app. Each account has to be changed individually in Mail's preferencess dialog, which is a pain. So I wrote this short AppleScript to automate the operation for me:
tell application "Mail"
  set account_List to (name of accounts)
end tell
set selected_Accounts to (choose from list (account_List) 
 with multiple selections allowed without empty selection allowed)
if selected_Accounts is not false then
  tell application "Mail"
    set include when getting new mail of every account to false
    repeat with this_account in selected_Accounts
      set (include when getting new mail of account 
       (contents of this_account)) to true
    end repeat
  end tell
end if
The script will display a list of accounts to be checked (highlight more than one by holding the Command key down), and makes the appropriate changes to the preferences automatically. Any account you do not select will not be checked.
    •    
  • Currently 1.50 / 5
  You rated: 2 / 5 (2 votes cast)
 
[4,021 views]  

A script to selectively enable accounts in Mail | 2 comments | Create New Account
Click here to return to the 'A script to selectively enable accounts in Mail' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to selectively enable accounts in Mail
Authored by: rotero on Mar 21, '05 10:51:55AM

This already exists here:

http://www.versiontracker.com/dyn/moreinfo/macosx/21620



[ Reply to This | # ]
A script to selectively enable accounts in Mail
Authored by: Anoble on Mar 24, '05 12:43:13PM

Does anyone here have the knowledge to program a script that will check your location setting and toggle an email account offline/online based upon the name of the location?

When at work, I use a location named "Work" which is ethernet, DHCP and inside the LAN. I'd like a Mail exchange account to be toggled on then.

When at home, the "Home" location is wireless, DHCP and not inside the LAN (w/o a VPN connect). I'd like the exchange account toggled offline then.

This script comes close, but I have no ability to get it to where it needs to be.

Any help would be greatly appreciated.

A



[ Reply to This | # ]