Re: An Applescript Cocktail
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