4.19.2012

Mac OS X "SOE" continued (adding applescript utilities)

Adding some applescripts GUI wrappers to some shell script utilities for my end users. Here is a applescript snippet showing how I place the shell script inside the app bundle and reference it (so my .app can be self contained).

set script to alias ((path to me) & "Contents:Resources:MYSCRIPT.sh" as string)
set scriptPOSIX to POSIX path of script
do shell script ("sudo chmod 755 '" & scriptPOSIX & "'") user name theSudoUser password theSudoPassword with administrator privileges
do shell script ("sudo '" & scriptPOSIX & "'") user name theSudoUser password theSudoPassword with administrator privileges