Re: System Events not working
Re: System Events not working
- Subject: Re: System Events not working
- From: Andrew Oliver <email@hidden>
- Date: Mon, 07 Apr 2003 12:11:11 -0700
Ummmm...?
What's wrong with:
tell application "Finder" to set collapsed of window 1 to true
It works in one line.
Does not require GUI Scripting to be installed.
Does not require the Finder to be the frontmost application.
Is portable - will work on any Finder version on any System, including
non-English systems.
(People seem to forget that referencing menus by name is inherently not
portable - it will not work in a French Finder, or a Spanish one, Japanese
one, or any other non-English system)
<rant>IMHO GUI Scripting is creating a whole new suite of AppleScript
problems... Too many people are trying to directly replicate the actions
they would take manually to perform a task - "click this menu bar, pull down
this menu, select this menu item" when there are much more direct ways of
achieving the desired result - "minimize this window"
GUI Scripting should be a last resort. It's a shame that it is required at
all to automate some tasks.
</rant>
On 4/7/03 11:40 AM, "John Delacour" <email@hidden> wrote:
>
At 2:11 pm -0400 7/4/03, Robert C. Jacobson wrote:
>
>
> tell application "System Events"
>
> tell process "Finder"
>
> tell menu bar 1
>
> click menu item "Minimize Window" of menu "Window"
>
> end tell
>
> end tell
>
> end tell
>
>
>
> Am I missing something real basic here?
>
>
>
It works fine here, provided you bring the Finder to the front first,
>
and you can do the whole thing more economically like this:
>
>
>
tell app "System Events" to tell process "Finder"
>
set frontmost to true
>
keystroke "m" with command down
>
end
>
>
>
--JD
>
_______________________________________________
>
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.
_______________________________________________
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.