Auto launch a .App package with a script through self service

osbalde
New Contributor

I'm having an issue with what I would thought was a simple problem, if anyone has any suggestions it would be much appreciated.

I have built a policy that will deploy a .app into the /Applications folder. I want the program to be initiated once the .app package is fully downloaded through a script without user interaction.

I thought it would just be:

#!
open /Applications/(program).app

Thanks,

Edmund

5 REPLIES 5

Lhsachs
Contributor II

You will need to nest a bit deeper - this will open word:
open /Applications/Microsoft Office 2011/Microsoft Word.app/Contents/MacOS/Microsoft Word

talkingmoose
Moderator
Moderator
open /Applications/(program).app

Run this command with the -a option, which tells the open command you're opening an application:

open -a /Applications/(program).app

russeller
Contributor III

Wouldn't this launch the app as root? Is that even an issue?

ryan_w
Contributor

I am looking to do this too, but need the app to run as the logged in user not root. Anyone have any luck with this?

leslie
Contributor II
Contributor II

App looks to open as the logged in user when initiated through self service. Note, you can also use the apps bundle identifier, i.e.:
open -b com.apple.textedit