Is it possible to run an OS X GUI app as root?
Don't use open
if you want to run as another user. Open launches the application you're asking for via LaunchServices which will load it as if you double clicked on it.
If you however run the application binary directly it'll work. So for example, as root (so from a script that's already running as root, or via sudo
) run /Applications/TextEdit.app/Contents/MacOS/TextEdit
and TextEdit will run as root.
You may want to try Pseudo for this, as you can use it to launch apps with the sysadmin's privileges.
I am not quite sure what you are asking though. If you want something to run automatically, you can, I guess, use the launch document feature of the program to create a launch path. I haven't used this feature, but it may be something you want to look into.