Skip to main content
Solved

The best way to deal with Dictionary MCX

  • January 16, 2015
  • 6 replies
  • 43 views

Forum|alt.badge.img+7

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.

Best answer by bentoms

@CypherCookie, why not a LaunchAgent?

6 replies

bentoms
Forum|alt.badge.img+35
  • Hall of Fame
  • Answer
  • January 16, 2015

@CypherCookie, why not a LaunchAgent?


Forum|alt.badge.img+7
  • Author
  • Contributor
  • January 16, 2015

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.


davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • January 16, 2015

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.


Forum|alt.badge.img+7
  • Author
  • Contributor
  • January 16, 2015

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.


Forum|alt.badge.img+7
  • Author
  • Contributor
  • January 16, 2015

@davidacland just tried your line and it worked a treat! :O


Forum|alt.badge.img+23
  • Valued Contributor
  • January 16, 2015

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.