Re: Scripting toolbar, etc windows
Re: Scripting toolbar, etc windows
- Subject: Re: Scripting toolbar, etc windows
- From: "Nigel Garvey" <email@hidden>
- Date: Tue, 21 Mar 2006 02:36:09 +0000
Robert Poland wrote on Mon, 20 Mar 2006 08:05:58 -0700:
>Hi,
>
>I'm trying to Script toolbar, etc window positions.
>
>This script doesn't get position. Any suggestions?
>
>try
> tell application "GraphicConverter" to activate
> tell application "System Events"
> tell process "GraphicConverter"
> set frontmost to true
> tell menu "Window" of menu bar item "Window"
>of menu bar 1
> click menu item 3 -- "Bring All to Front"
> if (get name of menu item 16) is
>"Show Toolbox" then click menu item 16
> end tell
> set {w, x} to position of window "Toolbox"
> end tell
> end tell
>end try
>w
Hi, Bob.
It seems that the names of GraphicConverter's floating windows are
missing values. Also, the contents of its Window menu come, go, and
change depending on the circumstances at the time. You can't rely on
items either existing or having a particular index number. One way to
identify the Toolbox window is to (re)open it so that it becomes window
1. Not very nice, but it may serve your purpose.
try
tell application "GraphicConverter" to activate
tell application "System Events"
tell process "GraphicConverter"
set frontmost to true
tell menu "Window" of menu bar item "Window" of menu bar 1
click menu item "Bring All to Front"
-- If the Toolbox window is open, close it.
if (menu item "Hide Toolbox" exists) then keystroke "k" using
command down
-- (Re)open the Toolbox window. It opens as window 1.
keystroke "k" using command down
end tell
set {w, x} to position of window 1
end tell
end tell
end try
w
NG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden