• 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
Bring a window to front
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bring a window to front


  • Subject: Bring a window to front
  • From: KOENIG Yvan <email@hidden>
  • Date: Sun, 10 Feb 2008 21:21:42 +0100

Hello

It seems that I am tired.

I'm unable to find the way to bring a Number's window to front so the script would be able to save every open doc.

Here is the script:

--[SCRIPT]
set theApp to "Numbers"

tell application "System Events" to set theAppIsRunning to (name of processes) contains theApp
if theAppIsRunning = true then
tell application theApp to activate
tell application "System Events" to tell application process theApp
set nw to get name of every window
repeat with n in nw
if subrole of (get properties of window n) is "AXStandardWindow" then
(* Here, I try to bring window n to front *)
my saveDoc(theApp)
end if
end repeat
end tell -- process…
end if -- if theAppIsRunning …



on saveDoc(theApp)
tell application "System Events" to tell application process theApp to keystroke "s" using {command down}
end saveDoc
--[/SCRIPT]


Is one of you able to open my eyes ?

Thanks in advance.
I will read you tomorrow.

Yvan KOENIG _______________________________________________
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: Bring a window to front
      • From: "EU - Luca Pozzato" <email@hidden>
  • Prev by Date: Re: do shell script vs. do script with command
  • Next by Date: Re: do shell script vs. do script with command
  • Previous by thread: Re: PHP and Applescript
  • Next by thread: Re: Bring a window to front
  • Index(es):
    • Date
    • Thread