• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: An Applescript Cocktail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: An Applescript Cocktail


  • Subject: Re: An Applescript Cocktail
  • From: Martin Orpen <email@hidden>
  • Date: Thu, 14 Apr 2005 15:59:39 +0100

Title: Re: An Applescript Cocktail
on 14/4/05 15:44, Bernard Azancot at email@hidden wrote:

> Hello scripters !
>
> I was just wondering if  a script could perform MacOS X,
> daily/weekly/monthly maintenance scripts, just as Cocktail utility
> does.

This used to work OK:

with timeout of 3600 seconds
   set
myButton to (items of (display dialog "What task do you want to run?" buttons {"daily", "weekly", "monthly"}) as string)
    
if
myButton is "daily" then
       set
x to do shell script "sudo /private/etc/daily" with administrator privileges
   end if
   if
myButton is "weekly" then
       set
x to do shell script "sudo /private/etc/weekly" with administrator privileges
   end if
   if
myButton is "monthly" then
       set
x to do shell script "sudo /private/etc/monthly" with administrator privileges
   end if
   --
ugly, but better than display dialog...
   choose from list (paragraphs of
x) with prompt "Read and then cancel:"
end timeout


Could do with tidying up as it’s a bit repetitive...

--
Martin Orpen
 _______________________________________________
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

  • Follow-Ups:
    • Re: An Applescript Cocktail
      • From: Sander Tekelenburg <email@hidden>
References: 
 >An Applescript Cocktail (From: Bernard Azancot <email@hidden>)

  • Prev by Date: An Applescript Cocktail
  • Next by Date: Re: Display Dialog
  • Previous by thread: An Applescript Cocktail
  • Next by thread: Re: An Applescript Cocktail
  • Index(es):
    • Date
    • Thread