Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to make a script for a terminal command

I need to find instructions on how to create a script to automatically run the following Terminal command;
Sudo chmod 755 /private/var/spool/cups. It will also need to include the admin password as you will be prompted to enter it after the command line is entered. Apparently the only way to get Quark 7 to print adobe pdf's is to open a terminal window and type the command every time the machine is rebooted. This is a temporary fix and I do not want the MAC users to have to type the command.

Thanks

Sal

Power MAC G5, Mac OS X (10.4.9)

Posted on Apr 12, 2007 9:06 AM

Reply
3 replies

Apr 12, 2007 10:30 AM in response to sbono

You can use an AppleScript for this.

Open the ScriptEditor and copy the lines into:
do shell script "chmod 755 /private/var/spool/cups" password "YourPassword" with administrator privileges

Then save the Script as Programm and put it in the Startup Items in your account.

At every Login, the script should be executed. When you want an password box, remove the lines for the password.

Apr 19, 2007 9:16 AM in response to Zerwas

Did not work. I kept getting an invald script error so I changed the line to read. do shell script "sudo chmod 755 "private/var/spool/cups" password " ***". I saved the file as an APP. I keep getting prompted for the password and if I type it in the propmt dissapears and does not seem to have changed the permissions on the cups folder.

Sal

Apr 20, 2007 1:04 PM in response to sbono

This Script works here. Get you the error, when you save or checks the syntax?

When you use in AppleScript the entry with administrator privileges, is sudo optional. This says only, if everyone can use the sudo command inside of the 5 minutes limit without to write the password again or not.

The Syntax do shell script "sudo chmod 755 "private/var/spool/cups" password "***" doesn´t work, because you need the entry with administrator privileges for the execution as privileged user.

How to make a script for a terminal command

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.