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

Swap foreground and background windows


  • Subject: Swap foreground and background windows
  • From: Quark67 <email@hidden>
  • Date: Sat, 23 May 2009 20:00:47 +0200

Hello, I have for exemple 3 windows in TextEdit.

I will made "Sans Titre 3" in background and "Sans titre" in foreground.

How can I made this?

I tryed this :
tell application "TextEdit"
set a to every window of application "TextEdit"
set b to item 1 of a --b is the foreground window, named "Sans titre 3", his index is 1
set c to count of a
set d to item c of a --d is the background window, named "Sans titre", his index is 3
set index of b to c --index of "Sans titre 3" becomes 3
set index of d to 1 --index of "Sans titre" becomes 1, so "Sans titre" must be in foreground
end tell

After the script, I have this :

(seeing from AppleScript Editor in foreground, this seems correct).

But, when, in Dock, I click to TextEdit, I see this :

Probably because the window "Sans titre 3" has keep his focus status, in spite of is index of 3.

I have tried to insert, before the "end tell" in previous script these lines :
tell application "System Events"
tell process "TextEdit"
set focused of window 1 to true -- window 1 is "Sans titre"
end tell
end tell

but this don't  have the effect.

I tryed also with :
set value of attribute "AXFocused" of window 1 to true
but no effect either.

Can you say how I can made this?
Thanks

(under Leopard 10.5.7).



 _______________________________________________
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: Swap foreground and background windows
      • From: Luther Fuller <email@hidden>
    • Re: Swap foreground and background windows
      • From: Christopher Nebel <email@hidden>
    • Re: Swap foreground and background windows
      • From: Michelle Steiner <email@hidden>
    • Re: Swap foreground and background windows
      • From: Yvan KOENIG <email@hidden>
  • Prev by Date: Re: Interacting with external shell scripts
  • Next by Date: Re: Swap foreground and background windows
  • Previous by thread: Re: changing the "open with application" value for a file
  • Next by thread: Re: Swap foreground and background windows
  • Index(es):
    • Date
    • Thread