Posted on 01-16-2015 05:44 AM
Aim : to get an application to automatically open upon login for users.
Problem : I've been trying to figure out the best way to try and get an application to start at login for users. What i've found is that its impossible to do in Casper unless you have machines being controlled by work group manager.
This is due to the fact that under the users preferences the login items are added as a dict entry. It would be possible to This is not an issue if you are creating these files for new users but they are for existing users who have already modified their login items.
Solution : The only way around this that i found was to write a simple script to create my own personal folder within their library, from that i can then write a file which i use as a flag to turn on or off the automatic open command for the application.
I use the simple "open" command to open the application every time and then exempt users by removing the file created in the directory i created.
You can use this method to set loads of different flags for different things.
Solved! Go to Solution.
Posted on 01-16-2015 05:46 AM
@CypherCookie, why not a LaunchAgent?
Posted on 01-16-2015 05:55 AM
You can add the item into their login items:
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/path/to/itemname.app", hidden:true, name:"Customized Name"}'
Create a policy and add this to the "Files and Processes" section under "Execute Command", set to once per user.
Posted on 01-16-2015 05:46 AM
@CypherCookie, why not a LaunchAgent?
Posted on 01-16-2015 05:50 AM
Yes you could do that, however I don't think i have adequate skills to implement that. We are doing a pilot and we want users to have the ability to turn off this function this was my solution.
I also imagine that what we have been told about how they want the application to act will change as well.
Posted on 01-16-2015 05:55 AM
You can add the item into their login items:
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/path/to/itemname.app", hidden:true, name:"Customized Name"}'
Create a policy and add this to the "Files and Processes" section under "Execute Command", set to once per user.
Posted on 01-16-2015 06:06 AM
Hi David,
I did try that and found that it didn't work on my 10.9.5 or 10.10.1 machine. thats why i ended up creating a script instead.
Posted on 01-16-2015 06:08 AM
@davidacland just tried your line and it worked a treat! :O
Posted on 01-16-2015 06:16 AM
Don't mess with success, but here's an alternative method...
The Login Items payload in an OS X Configuration Profile can achieve this as well.