Re: Using GUI Scripting to set window positions
Re: Using GUI Scripting to set window positions
- Subject: Re: Using GUI Scripting to set window positions
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 19 Apr 2004 06:13:33 -0400
on 2004-04-18 9:40 PM, Jim Witte at email@hidden wrote:
>
> GUI Scripting should be able to, and it used to be able to, but it
>
> currently
>
> cannot. The wiring is all there in the Accessibility API, but GUI
>
> Scripting
>
> just doesn't do it.
>
>
Should this be considered a bug to report to BugReporter -
>
considering that it could very easily and doesn't?
Yes. Either they should make it work, or they should change the dictionary
so it doesn't claim it will work. I would much prefer the former, of course.
Bug reports always help.
>
Another annoying
>
bit was the example syntax used by GUI elements for menus:
>
>
tell application "System Events"
>
tell process "Finder"
>
tell menu bar 1
>
tell menu bar item "View"
>
tell menu "View"
>
tell menu item "Arrange"
>
tell menu "Arrange"
>
click menu item "by Size"
>
end tell [...]
>
>
(This strongly reminds me of Scheme..) Wouldn't it just be easier
>
(and I'd think relatively algorithmic for System Events to do) for the
>
block to be
>
>
tell application "System Events"
>
tell process "Finder
>
tell menu bar 1 -- in here if there is more than one "menubar" -
>
perhaps 1 could be default
>
tell menu "View"
>
tell submenu "Arrange" -- this would be expanded to menu
>
and menu item
>
click menu item "by Size"
>
end tell [..]
>
>
Or is the convoluted syntax just a little inducement to get Prefab
>
Player?
Make that PreFab UI Browser...!
So far, at least, GUI Scripting has been implemented as a one-to-one mirror
of the internal structure, which in Mac OS X sees two objects for every
hierarchical menu: the menu, and the menu item. It would certainly be easier
for scripters to see only the pieces of the hierarchy that they can do
something with, but it's really just a matter of how much you have to type.
The multiple nested tells can of course be written as a traditional
reference: 'click menu item "by Size" of menu "Arrange" of menu item
"Arrange" of menu "View" of menu bar item "View" of menu bar 1', which is
what UI Browser generates.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.