• 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: Sun, 05 Jun 2016 08:31:38 -0500

On Jun 05, 2016, at 05:53, Yvan KOENIG <email@hidden> wrote:

Caution

The index of a window may have different values. Three different lists exist.
______________________________________________________________________

Hey Yvan,

Well, it doesn't surprise me at all that the window menu does it's own thing, but I'm wondering why the indexing is different for you with vanilla AppleScript in Safari and with System Events.

-------------------------------------------------------------------------------------------
tell application "System Events"
   tell application process "Safari"
      tell (windows whose subrole is "AXStandardWindow")
         set sevWinNameList to name
      end tell
   end tell
end tell

set x to " "

tell application "Safari"
   set vanillaAppleScriptWinNameList to name of windows where its document is not missing value
end tell

items 1 thru -2 of {¬
   sevWinNameList, ¬
   vanillaAppleScriptWinNameList, ¬
   ""}
-------------------------------------------------------------------------------------------

On my system these two come up the same:

{
   {
      "Apple", 
      "Apple Mac OS X Software & Apps - Discover & Download : MacUpdate", 
      "Google", 
      "A New Toy - Keyboard Maestro Discourse"
   }, 
   {
      "Apple", 
      "Apple Mac OS X Software & Apps - Discover & Download : MacUpdate", 
      "Google", 
      "A New Toy - Keyboard Maestro Discourse"
   }
}

One warning – if Safari has been hidden then both methods change.

--
Take Care,
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: Yvan KOENIG <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>)
 >Re: strange behavior setting window index to 1 in Safari (From: David Gregg <email@hidden>)

  • Prev by Date: Re: How to create a document?
  • 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