Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Disable Mail.app accounts AppleScript

Disable Mail.app accounts AppleScript
Thread Tools
mdc
Addicted to MacNN
Join Date: Feb 2003
Location: NY²
Status: Offline
Reply With Quote
Oct 11, 2006, 01:29 PM
 
I need to make an AppleScript that will disable 2 email accounts in Mail.app. I am not too sure where to go with AppleScript to pull this off.
I looked in the Mail.app "dictionary" for AppleScript and there is a property of an account for enabled or not, but I do not know how to tell Mail to disable it if it is enabled and vice versa.

I'd be very appreciative if someone could point me in the right direction.

The reason I need this is because if Mail downloads mail from my pop3 account my blackberry won't download the email, even though Mail is set to not do anything to the email on the server.
I'd like to be able to email an account I setup and when mail arrives a rule runs which runs my applescript to disable my primary email account.

Convoluted? Yes, but a fun project nevertheless.
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Oct 11, 2006, 06:01 PM
 
Code:
tell application "Mail" set enabled of account named "YourAccountName" to false end tell
     
mdc  (op)
Addicted to MacNN
Join Date: Feb 2003
Location: NY²
Status: Offline
Reply With Quote
Oct 12, 2006, 08:50 AM
 
Perfect, thanks.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:38 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2