• 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
Re: Mail Activity Window is Front?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail Activity Window is Front?


  • Subject: Re: Mail Activity Window is Front?
  • From: Christopher Stone <email@hidden>
  • Date: Sun, 25 Oct 2015 01:44:33 -0500

On Oct 25, 2015, at 01:09, Christopher Stone <email@hidden> wrote:
Certain Keyboard Maestro macros I have for manipulating the UI don't work properly with the changes, and I'll have to try to work around them.  This is a bother but not a big deal.
______________________________________________________________________

Hey Folks,

Okay.  Here's how I worked around the problem.

This keeps focus on the front mail-viewer-window when opening the Activity window, so my Keyboard Maestro macros perform the correct actions.  It closes the Activity window if it's open already.

--
Best Regards,
Chris

--------------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2015/10/25 01:15
# dMod: 2015/10/25 01:30
# Appl: Mail, System Events
# Task: Toggle the Activity Window Open/Closed and bring focus back to the front Mail-Viewer.
# Tags: @Applescript, @Script, @Mail, @System_Events, @Toggle, @Activity, @Window, @Open, @Closed
# Note: Tested only on 10.11.1 with Mail in Classic-View.
--------------------------------------------------------------------------------------

try

  

  tell application "System Events"
    tell application process "Mail"
      set frontmost to true
      if (name of windows) does not contain "Activity" then
        tell menu "Window" of menu bar item "Window" of menu bar 1
          click menu item "Activity"
          click menu item "Message Viewer"
        end tell
      else
        tell window 1
          tell attribute "AXCloseButton"
            click its value
          end tell
        end tell
      end if
    end tell
  end tell

  

on error e number n
  stdErr(e, n, true, true) of me
end try

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

 _______________________________________________
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

  • Follow-Ups:
    • Re: Mail Activity Window is Front?
      • From: Yvan KOENIG <email@hidden>
References: 
 >Mail Activity Window is Front? (From: Christopher Stone <email@hidden>)

  • Prev by Date: Mail Activity Window is Front?
  • Next by Date: Script Editor phantoms
  • Previous by thread: Mail Activity Window is Front?
  • Next by thread: Re: Mail Activity Window is Front?
  • Index(es):
    • Date
    • Thread