Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

We are trying to have a simple drive mapping script start up for ALL users on a Mac Mini. What's the simplest way of going by doing this? I've tried creating a .plist in Lingon and adding it to the Library LauncherDaemons and LauncherAgents folders, but it's not starting up. Any ideas? Is there a way to do this in the Terminal? The script by itself works fine and works if we add it to the Startup Items in System Preferences, but we want this to be automatic and for all users.

Thanks.

share|improve this question

1 Answer 1

Save a property list like this as /Library/LaunchAgents/test.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>test</string>
        <key>ProgramArguments</key>
        <array>
            <string>say</string>
            <string>aa</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
    </dict>
</plist>

It should be loaded automatically on the next login.

See man launchd, man launchctl, and man launchd.plist for more information.

share|improve this answer
    
That worked perfectly! So how would I call up a .app script with this? Would I just put the path in a new string? Thanks. EDIT: Actually, it looks like it only worked for the user that added it (I made sure to put it in the system library too). Very weird. –  user1809994 Dec 10 '12 at 15:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.