Cache administration?

How would i make it so that people would only need to type their password in once, and be able to do many things With administrative privileges? Do i have it ask for the password when the application opens?

Yes. Then either store it as a property (in which case it will persist until the app is next compiled) or store it as a preference file.

How would i go about doing that?

Well you could define a property at the top of the script, which will be available from all your handlers and retains its value until you quit.

property AdminPassword : ""

So ask for the user password in a dialog and set the property to that value for use whenever you need it.

As for persisting between launches of the application you’ll want to look into Keychain Scripting to store the password inside the user’s Keychain - you don’t really want to be storing people’s passwords in a preferences .plist.

Have a search through the MacScripter forums for Keychain Scripting I found out how to get that working through here myself :slight_smile: