• 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: David Gregg <email@hidden>
  • Date: Sat, 04 Jun 2016 15:37:54 -0600

> On Jun 4, 2016, at 3:19 PM, Christopher Stone <email@hidden> wrote:
>
> 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
> ------------------------------------------------------------

Here is another method that I find works quite well in many of the resistant apps.

set windowIndexNum to 2

tell application "System Events"
	tell application process "Safari"

		set frontmost to true
		delay 1
		set value of attribute "AXMain" of window windowIndexNum to true

	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


References: 
 >strange behavior setting window index to 1 in Safari (From: Mitchell L Model <email@hidden>)
 >Re: strange behavior setting window index to 1 in Safari (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: strange behavior setting window index to 1 in Safari
  • Next by Date: How to create a document?
  • 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