Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

script to take account offline

I need an (Apple)script to take an account offline or better all accounts. Is this possible?

Help appreciated!

Macbook Pro, Mac OS X (10.5.1)

Posted on Mar 19, 2009 3:20 AM

Reply
Question marked as Best reply

Posted on Mar 19, 2009 5:55 AM

this particular function doesn't seem to be scriptable unless you use GUI scripting. that's pretty hateful so i would not recommend it. but you can script completely enabling/disabling an account which will of course also take it offline. to do this run

<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
tell application "Mail"
set enabled of account "Gmail" to false

end tell</pre>

change false to true in the script to enable it again. put the name of your account instead of "Gmail" in the above.
2 replies
Question marked as Best reply

Mar 19, 2009 5:55 AM in response to manilx

this particular function doesn't seem to be scriptable unless you use GUI scripting. that's pretty hateful so i would not recommend it. but you can script completely enabling/disabling an account which will of course also take it offline. to do this run

<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
tell application "Mail"
set enabled of account "Gmail" to false

end tell</pre>

change false to true in the script to enable it again. put the name of your account instead of "Gmail" in the above.

script to take account offline

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.