• 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: Swap foreground and background windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Swap foreground and background windows


  • Subject: Re: Swap foreground and background windows
  • From: Quark67 <email@hidden>
  • Date: Mon, 25 May 2009 00:04:26 +0200


Le 24 mai 09 à 23:45, Steven Audette a écrit :

tell application "System Events"
set myApp to first application process whose name is "TextEdit"
-- If you are running from a Script launcher like FastScripts, you might want something like this...
-- set myApp to first application process whose frontmost is true

-- This creates a filterd list of windows that ignores floating windows and minimized windows
set myWindows to (every window whose (subrole is "AXStandardWindow" and value of attribute "AXMinimized" is false)) of myApp

-- We need at least two windows to swap
if (count of myWindows) < 2 then
beep
return
end if

-- The magic that gets the back most window to the front
perform action "AXRaise" of last item of myWindows
end tell

Interesting… I will test that tomorrow, by adding windows in TextEdit, then in Safari.

 _______________________________________________
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: 
 >RE: Swap foreground and background windows (From: Steven Audette <email@hidden>)

  • Prev by Date: Re: Swap foreground and background windows
  • Next by Date: Opening AppleScript *.app files for editing
  • Previous by thread: RE: Swap foreground and background windows
  • Next by thread: Re: Swap foreground and background windows
  • Index(es):
    • Date
    • Thread