Re: Running this script without the "Enable access for assistive devices" box checked
Re: Running this script without the "Enable access for assistive devices" box checked
- Subject: Re: Running this script without the "Enable access for assistive devices" box checked
- From: J Stewart <email@hidden>
- Date: Mon, 23 May 2005 08:35:09 -0400
On 05/23/05 at +0100 David Siberry said this
>Hi, Im writing an apple script to close a window. the script im using is:
>
>tell application "Finder"
> set theWindows to (get every Finder window)
> repeat with eachWindow in theWindows
> if (target of eachWindow as text) begins with "Mac OS X:" then
> close eachWindow
> end if
> end repeat
>end tell
>
>however I find if I have the "Enable access for assistive devices"
>check box checked (located in System Preferences | Universal Access),
>the script wont work.
>Is there anyway I can run this script without checking the check box?
This closes all Finder windows ->
tell application "Finder" to close windows
and this will close a subset of Finder windows ->
tell application "Finder" to close (get every window whose name contains "Mac OS X")
Neither of these oneliners has any conflict with or usage of GUI scripting. Please note that in the seconf script I used "contains" instead of "begins with", either syntax should work. I just didn't test a "begins with" version.
JBS
--
I thought about how mothers feed their babies with tiny little spoons and forks, so I wondered what do Chinese mothers use? Toothpicks? - George Carlin
_______________________________________________
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