Applescripter Needed!

owaters

Registered
Hi,

Thanks for reading this :)

I am having some trouble with 2 applescripts:

The first
I am trying to do a script that automatically starts Apache through the terminal. So far I have come up with:

tell application "Terminal"
set password to "mypassword"
do shell script "sudo apachectl graceful" with administrator privileges and password
end tell

This doesn't seem to work though! Have any ideas??

The Second
I want a script to ask for any number of minuted to be entered.
It will then ask for a name of an iTunes playlist to play.
It would then start iTunes, bring it to the front and play the specific playlist for the specific length of time.

Any ideas on how I could do this and how it would be done?

Thanks!
 
Where did you get that sample AppleScript from? I don't think that's even valid Terminal syntax.

Run the AppleScript Editor, choose "Open Dictionary" from the File menu, and "Terminal" from the dictionary list. This will show Terminal's AppleScript commands. You should be using something like:
Code:
tell application "Terminal" to do script with command "sudo  apachectl graceful"
I don't think you can script typing a password.

As for iTunes, open the iTunes AppleScript dictionary from the script editor and see what commands ara available.
 
Back
Top