Setting priority on AppleScript Newb

Hi,

I was wondering if there is any way to set the priority on an apple script. I’m using a script to do simple server maintenance, it looks similar to this:

do shell script “sudo chmod -RN /Path/Dir/” with
administrator privileges
do shell script “sudo chmod -R 777 /Path/Dir/” with
administrator privileges
do shell script “sudo chown -R admin:public /Path/Dir/” with
administrator privileges

The script works great but the problem is that is bogging down the whole server while it is running. Is there anyway to slow the process down, set priority, or allocate a specific amount of RAM to the process?

Oh, I’m running Leopard Server by the way

Thanks!

It sounds like the bottleneck may be because of the way you are containing the command in the AppleScript compiler. Sending the command to the terminal directly may kill the overhead, if you don’t mind opening a terminal window.

If you want to use the Terminal, try this nomenclature:

tell application "Terminal"
activate
do script "mv ~/Desktop/myfile.txt ~/Documents/myfile.txt"
end tell
tell terminal to quit

note absence of the word “shell”.