Mac Forums

Mac Forums (
-   OS X - Development and Darwin (
-   -   applescript and administrator! (

NewbieStu 12-30-2011 07:19 PM

applescript and administrator!
I am an Applescript newbie. I wrote the following script to create a folder in MacHD>Library>Applications Support which is now write-protected in Lion (a change from Snow Leopard). It works fine, creating the folder if one of that name is not already there, skipping if folder already exists, asking for an administrator password on the way (no prob). The problem arises if the user cancels the request for the administrator password. Another request pops up, If this is canceled the script completes as if the folder had been created. How can I trap the Cancel command and cancel the whole script? Many, many thanks.


tell application "Finder"
make new folder at folder "Application Support" of folder "Library" of startup disk with properties {name:"foldername"}
end try
display dialog "The missing folder has been successfully installed." buttons {"OK"} default button 1
end tell

NewbieStu 12-31-2011 09:21 AM

Problem solved
I've solved this problem. Sorry to bother.

All times are GMT -4. The time now is 11:58 AM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.