• 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
Apple Mail – Press the “All” Button for Global Searching
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Apple Mail – Press the “All” Button for Global Searching


  • Subject: Apple Mail – Press the “All” Button for Global Searching
  • From: Christopher Stone <email@hidden>
  • Date: Sun, 19 Feb 2017 01:28:28 -0600

Hey Folks,

As people who use Mail know – the Mailbox Search is local to the selected mailboxes.

To make a search global you have to manually click the “All” button in the Mailboxes toolbar of the message-viewer window you're searching in.

I do a lot of global searches, and I finally got absolutely sick of reaching for the mouse.

-------------------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2017/02/19 00:55
# dMod: 2017/02/19 01:07
# Appl: Mail with System Events
# Task: Click “All” button when Mailbox Search field is active.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @System_Events, @Click, @All, @Button, @Search, @Field, @Active
-------------------------------------------------------------------------------------------

tell application "System Events"
   tell application process "Mail"
      tell (first window whose subrole is "AXStandardWindow")
         if name of first button of toolbar 1 = "Get Mail" then
            tell checkbox "All" of group 7
               if its value = 0 then
                  click
               else
                  beep
               end if
            end tell
         end if
      end tell
   end tell
end tell

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

The trick is that once you've selected the “All” button it will NOT get unselected without more mouse-intensive intervention.

I get around this by opening a new message-viewer window whenever I want to do a global search.

When that window is closed its All status goes away too.

** Remember – this is System Events and is sensitive to UI changes – the script may not work on your system without some tweaking.

Tested on macOS Sierra 10.12.3.

--
Best Regards,
Chris

 _______________________________________________
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: Need Reference for "tell application" forms
  • Next by Date: Re: set theAttachments to theMessage's mail attachments fails when called by a rule
  • Previous by thread: Re: multiple monitors
  • Next by thread: scale
  • Index(es):
    • Date
    • Thread