Script/Automator App in Profile Manager Login Settings

I don't know if I am going the wrong direction, but what I am looking to do is set workstation settings via an Apple Script. Everything seems to work Ok the way I want it to when run from the machine itself, but when I try to have the script or Automator app set as a Login Item in Profile Manager, things don't work. I don't know if I am typing in something wrong or what. I would like the script or Automator app to live on the server and run when the user logs in.


What I am wanting to do is set the default wallpaper to our company background, mount network shares on a Yosemite server, and eventually set printers via Apple Script or Automator app.


What I have done so far to try is have the Automator app called login.app located on a file share on my Yosemite server in a directory that has everyone read permissions on it.


In Profile Manager I have tried both Authenticated Network and regular Network mounts to the share where login.app is located. This seems to work 50% of the time and the share gets mounted.


I then tried to set the login.app application as a login item (giving it a full smb path and also a /Volumes/share path as well. Neither of these seem to work.


I don't know if I am going about this the wrong way, but I have been trying to solve this for the past 4 days without luck. Also as a side note I have tried doing this through a script, but I don't know if I am doing that correctly as I never really have written a login script for Mac before and it seems resources on how to do this seem slim.


Any help is appreciated.

Posted on May 18, 2015 11:50 AM

Reply
4 replies

May 19, 2015 2:14 AM in response to Foxtrot79

Mavericks and later no longer use the preference file ~/Preferences/com.apple.desktop.plist instead the setting is stored in ~/Library/Application Support/Dock/desktoppicture.db which is not a plist file but instead a SQLite database.


Also while in theory it might be possible to use a native AppleScript it is far more typical to use a Shell Script in things like Profiles, you can execute an AppleScript command inside a Shell Script and the following is an example that does set the Desktop Picture.


#!/bin/bash
osascript -e "tell application \"System Events\" to set picture of every desktop to \"/Library/Desktop Pictures/Earth Horizon.jpg\""
exit


It would be far easier if Apple had left things as a plist, one could then simply define a Custom payload which would set a value in the plist. In this case either you will need to add this as a LaunchAgent in each users home directory, or in the /Library/LaunchAgents folder so that it applies to all users on that machine.


(LaunchAgents involve two files, one is a plist defining what and how to run, the other is the actual script, read up on launchd/launchctl)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Script/Automator App in Profile Manager Login Settings

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.