• 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: Andrew Oliver <email@hidden>
  • Date: Sun, 17 Apr 2005 10:47:02 -0700

On 4/17/05 6:07 AM, "Bernard Azancot" <email@hidden> wrote:

>
> Le 15 avr. 05, à 13:49, email@hidden a
> écrit :
>
>> I use this:
>>
>> set actionList to (choose from list {"daily", "weekly", "monthly"} with
>> prompt "Pick 1 or more tasks to run" with multiple selections allowed)
>> if actionList ‚ false then -- user didn't cancel
>> set task_list to ""
>> repeat with i in actionList
>> set task_list to task_list & " " & i
>> end repeat
>> do shell script ("sudo periodic" & task_list) with administrator
>> privileges
>> end if
>>
>>
>> --
>> Sander Tekelenburg, <http://www.euronet.nl/~tekelenb/>
>
> Does not compile ??

After addressing the aforementioned line break issues, and the "... with
administrator privileges" which should also be on one line, the script
compiles fine here, so more info required, please.

'does not compile' doesn't help anyone. "does not compile and selects the
line xx with a dialog saying 'yyy'" is far more informative and lets others
quickly narrow down the problem. The error message, in particular, often
identifies the problem if you can decipher them.

If it's a case of the script compiling, but not doing what you want, that's
a different matter, and I'd assume it was because of the line:

> do shell script ("sudo periodic" & task_list) with administrator privileges

When run and task_list contains one or more periodic scriptnames (e.g.
"weekly"), the do shell script sees:

> do shell script ("sudo periodicweekly") with administrator privileges

For one, DO NOT use sudo in 'do shell script'. The 'with administrator
privileges' takes care of that part for you. Secondly, you need a space
between 'periodic' and the script name to run, so:

> do shell script ("periodic " & task_list) with administrator privileges

should work just fine.

Andrew
:)

 _______________________________________________
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>
    • Re: An Applescript Cocktail
      • From: Gnarlodious <email@hidden>
References: 
 >Re: An Applescript Cocktail (From: Bernard Azancot <email@hidden>)

  • Prev by Date: Re: Finder bug: MS-DOS format disks
  • Next by Date: Re: An Applescript Cocktail
  • Previous by thread: Re: An Applescript Cocktail
  • Next by thread: Re: An Applescript Cocktail
  • Index(es):
    • Date
    • Thread