Shell to AppleScript help

Hi Folks,

I’m running into more and more situations where normal AuthoricationShell operations are failing with no feedback. One of my uses recommended that I look into using AppleSCript to solve this (the apps are NOT MAS candidates and are not sandboxed).

Here’s where I do in the shell script - I write this into a safe temp file. It is possible the just calling an AppleScript that executes THIS shell script with administrative privileges is all that I need? I’m running into mixed results and suspect that it’s simply my lack of understanding.

        t = "#!/bin/bash" + EndOfLine.UNIX + _
        "rm /usr/local/bru-server" + EndOfLine.UNIX + _
        "mkdir -p /usr/local/bru-server/localprefs" + EndOfLine.UNIX + _
        "cp -r """ + MyAppPath + "/Contents/Tools/""* /usr/local/bru-server/" + EndOfLine.UNIX + _
        "rm -rf /usr/local/bru-server/CVS" + EndOfLine.UNIX + _
        "chown root:wheel /usr/local/bru-server/*" + EndOfLine.UNIX + _
        "chmod 4755 /usr/local/bru-server/agent" + EndOfLine.UNIX + _
        "chmod 1777 /usr/local/bru-server/localprefs" + EndOfLine.UNIX

The API’s the Authorization Shell uses, specifically AuthorizationExecuteWithPrivileges, was deprecated in 10.7
(see https://developer.apple.com/library/mac/documentation/Security/Reference/authorization_ref/)
Its one reason it was removed from the examples

I would hazard a guess thats what you’re running into

Would running this from AppleScript help ?
It might just change the nature of the problem from Xojo to AppleScript
And you still have to somehow run the AppleScript with admin privileges (although you might be able to use an apple script to do that)