Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Blarged

macrumors newbie
Original poster
Apr 14, 2008
24
0
Hey all,

I have a script that performs in three sections (not modular though): Setup, Run, Cleanup. Simple enough, eh?

In the Run section, I have a shell script being run with administrator privileges. However, when I cancel out of the password box, my script quits without running the Cleanup lines.

I need the Cleanup lines to be run regardless of whether the shell script with administrator privileges is run or not.

Any ideas?

Code:
--Setup
**setup code here**
--/Setup

do shell script "./foo.ss" with administrator privileges

--Cleanup
**cleanup code here
--/Cleanup
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.