Re: Bring a window to front
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