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

Re: Bring a window to front


  • Subject: Re: Bring a window to front
  • From: KOENIG Yvan <email@hidden>
  • Date: Mon, 11 Feb 2008 17:29:36 +0100


Le 11 févr. 2008 à 02:24, EU - Luca Pozzato a écrit :

hi Yyan,
i think this should do the trick…

click menu item n of menu "Window" of menu bar item "Window" of menu bar 1

ciao

Luca

Hello

Here is the late international version.

--[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 menu item of menu 1 of menu bar item 10 of menu bar 1
if (count of nw) > 5 then
repeat with i from 6 to count of nw
set n to (item i of nw) as Unicode text (* grab name of a document's window *)
if value of attribute "AXEdited" of button 1 of window n is true then (*
the doc was edited since last Save *)
click menu item n of menu 1 of menu bar item 10 of menu bar 1 (* bring window n to front *)
my saveDoc(theApp)
end if
end repeat
end if
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]



I keep the handler because it is used by other portions of the complete script.
It saves only document edited since last Save.
If one of the open documents was never saved, a dialog asking "where must I save it" is displayed.


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
References: 
 >Bring a window to front (From: KOENIG Yvan <email@hidden>)
 >Re: Bring a window to front (From: "EU - Luca Pozzato" <email@hidden>)

  • Prev by Date: Re: HTML emails in Entourage
  • Next by Date: InDesign postscript question
  • Previous by thread: Re: Bring a window to front
  • Next by thread: Add Login item to the list
  • Index(es):
    • Date
    • Thread