Re: Disabling Expose
Re: Disabling Expose
- Subject: Re: Disabling Expose
- From: kai <email@hidden>
- Date: Tue, 15 Nov 2005 04:48:43 +0000
On 15 Nov 2005, at 03:24, Todd Geist wrote:
I there a way to disable Expose with an Applescript?
You could disable access to Exposé's features, Todd. I have an idea
there may be more effective ways to do this, but it would take me a
while to figure out the precise mechanics. So, for the moment, I can
only offer UI scripting - which in this case is quite laborious.
However, FWIW, this should toggle the settings for you:
--------------------
property disabledSet : {"-", "-", "-", "-", "-", "-", "-", "-", "-",
"-", "-", "-"}
property defaultSet : {"-", "-", "-", "-", "F9", "F10", "F11", "F12",
"-", "-", "-", "-"}
property customSet : missing value
on singleList(l)
tell l
set l to beginning
repeat with i in rest
set l to l & i
end repeat
l
end tell
end singleList
to confirmChange(c, q)
tell application "System Preferences" to if ¬
button returned of (display dialog c & ¬
" access to Exposé features?" buttons ¬
{" Cancel ", c} default button c with icon 1) is " Cancel " then
if q then quit
error number -128
end if
end confirmChange
to changeSet for l to s
using terms from application "System Events"
tell singleList(l) to repeat with i from 1 to count
set v to s's item i
tell item i to if value is not v then
click
click menu 1's menu item v
repeat until value is v
delay 0.1
end repeat
end if
end repeat
end using terms from
end changeSet
to activateExpose()
tell application "System Preferences"
activate
set current pane to pane id "com.apple.preference.expose"
end tell
end activateExpose
tell application "System Events" to tell process "System Preferences"
set quitSysPrefs to not (exists)
my activateExpose()
tell pop up buttons of groups of window 1
set currSet to my singleList(value)
if currSet is disabledSet then
my confirmChange("Restore", quitSysPrefs)
if customSet is missing value then
my (changeSet for it to defaultSet)
else
my (changeSet for it to customSet)
end if
else
my confirmChange("Disable", quitSysPrefs)
if customSet is missing value then set customSet to currSet
my (changeSet for it to disabledSet)
end if
end tell
if quitSysPrefs then tell application "System Preferences" to quit
end tell
--------------------
---
kai
_______________________________________________
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