Re: Dashboard script needs some help
Re: Dashboard script needs some help
- Subject: Re: Dashboard script needs some help
- From: Tommy Bollman <email@hidden>
- Date: Thu, 22 Jul 2010 19:06:36 +0200
Hello jeffrey
This should work.
set theRes to button returned of (display dialog "Dashboard Control." buttons {"Cancel", "Disable", "Enable"} default button 3)
-- it just dies if you hit cancel.
if theRes is "Disable" then
do shell script "defaults write \ncom.apple.dashboard mcx-disabled -boolean YES; killall Dock"
tell me
activate
display alert "Dashboard has been disabled."
end tell
else
do shell script "defaults write \ncom.apple.dashboard mcx-disabled -boolean NO ; killall Dock"
tell me
activate
display alert "Dashboard has been enabled." buttons {"OK"}
end tell
end if
On 22 Jul 2010, at 18:55, email@hidden wrote:
> Hello Scripters,
>
> I have a little script that turns Dashboard on or off. I'm not sure how to
> set it up correctly so that when a button is pushed the appropriate action
> follows. I think I'm close but would really appreciate any help. Thanks.
>
> display dialog "Dashboard Control." buttons {"Cancel", "Disable",
> "Enable"} default button 3
> if result is "Disable" then do shell script "defaults write
> com.apple.dashboard mcx-disabled -boolean YES"
> do shell script "killall Dock"
> display dialog "Dashboard has been disabled." buttons {"OK"}
> end
> if result is "Enable" then do shell script "defaults write
> com.apple.dashboard mcx-disabled -boolean NO"
> do shell script "killall Dock"
> display dialog "Dashboard has been enabled." buttons {"OK"}
> end
>
>
> Jeff Madson • RR Donnelley Desktop Engineering
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
Best regards
Tommy Bollman
--------------------------------------------------------------------------------------------------
Mollison's Bureaucracy Hypothesis:
If an idea can survive a bureaucratic review
and be implemented it wasn't worth doing.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden