• 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: strange behavior setting window index to 1 in Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange behavior setting window index to 1 in Safari


  • Subject: Re: strange behavior setting window index to 1 in Safari
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 04 Jun 2016 16:19:18 -0500

On Jun 04, 2016, at 12:56, Mitchell L Model <email@hidden> wrote:
tell application "Safari"
set the index of window 2 to 1
end tell

brings the second window to the front but leaves focus in the previously front window.
______________________________________________________________________

Hey Mitchell,

This is an infuriating long-term bug in OSX (since Mountain Lion if memory serves).

It affects more apps than just Safari.

------------------------------------------------------------
set windowIndexNum to 2

tell application "System Events"
  tell application process "Safari"
    set winList to (windows whose subrole is "AXStandardWindow")
    tell item windowIndexNum of winList
      perform action "AXRaise"
    end tell
  end tell
end tell
------------------------------------------------------------

I'm doing it this way rather than using the window name, because Safari can have duplicate window names.

--
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

  • Follow-Ups:
    • Re: strange behavior setting window index to 1 in Safari
      • From: David Gregg <email@hidden>
References: 
 >strange behavior setting window index to 1 in Safari (From: Mitchell L Model <email@hidden>)

  • Prev by Date: Re: strange behavior setting window index to 1 in Safari
  • Next by Date: Re: strange behavior setting window index to 1 in Safari
  • Previous by thread: Re: strange behavior setting window index to 1 in Safari
  • Next by thread: Re: strange behavior setting window index to 1 in Safari
  • Index(es):
    • Date
    • Thread