• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Toggle Mail's Inbox Open/Closed with System Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Toggle Mail's Inbox Open/Closed with System Events


  • Subject: Toggle Mail's Inbox Open/Closed with System Events
  • From: Christopher Stone <email@hidden>
  • Date: Sun, 25 Oct 2015 00:21:23 -0500

Hey Folks,

After installing OSX 10.11.1 I've had far too many email connection failures.

The accounts consistently affected are the POP accounts of my domain on GoDaddy.

I've come to really dislike that dark triangle with the explanation point...

When I see it I always look to see specifically which accounts are offline, but it's gotten tedious to open and later close the Inbox by hand.   (I don't like to leave it open, because seven mail accounts take up a little too much vertical room on-screen.)

Once again I'm rescued from tedium by AppleScript – saved by System Events no less.

I will reiterate that I'm very happy System Events is faster and more reliable.

--
Best Regards,
Chris

--------------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2015/10/25 11:45
# dMod: 2015/10/25 00:09
# Appl: Mail, System Events
# Task: Toggle the Inbox in the Mailbox Pane open/closed.
# Tags: @Applescript, @Script, @Mail, @System_Events, @Toggle, @Inbox, @Open, @Closed.
# Note: This is tested on 10.11.1 with Mail in Classic-View.
--------------------------------------------------------------------------------------

try
  tell application "Mail" to some message viewer whose index is 1
on error
  error "Front window is not a message viewer!"
end try

--------------------------------------------------------------------------------------

tell application "System Events"
  tell application process "Mail"
    tell (first window whose subrole is "AXStandardWindow")
      tell outline 1 of scroll area 1 of splitter group 1
        tell row 2
          set value of attribute "AXDisclosing" to not (value of attribute "AXDisclosing")
        end tell
      end tell
    end tell
  end tell
end tell

--------------------------------------------------------------------------------------

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Mail: preview pane is visible
  • Next by Date: Mail Activity Window is Front?
  • Previous by thread: Re: setting message to unread
  • Next by thread: Mail Activity Window is Front?
  • Index(es):
    • Date
    • Thread