I have a simple Automator script that is setup to run as a login item. The Automator scripts plays a .wav file as follows:

afplay "/Users/Audio Files/system_alert.wav"

This works perfectly however I am looking to refine it to play on just the initial login of a user vs subsequent logins due to the system being either manually locked or automatically locking. I am currently running OS X 10.8.1 Mountain Lion. Is this somehow possible? I have Googled around and have not found much in the way of obvious options.

  • Do you want the script to run once the first time a user logs in, and then never run again for that user?
    – Daniel
    Sep 17, 2012 at 15:06
  • If you have the script defined as a login item in Preferences, doesn't it get called only during first login already?
    – nohillside
    Sep 17, 2012 at 15:11
  • I would like the script to run every time the computer is warm rebooted or cold started (upon user login). Similar to functionality of a Windows startup sound.
    – Mort
    Sep 17, 2012 at 15:14
  • @patrix It does indeed but it is called every time said user logs in. This is my issue, I need it to run only on the initial first login, not every time said user logs into the system again due to the system locking for security.
    – Mort
    Sep 17, 2012 at 15:17
  • 1
    Do you logout the user after inactivity? Login items don't get re-executed if you just enter the screensaver password.
    – nohillside
    Sep 17, 2012 at 15:18

1 Answer 1


I am closing this question. I rebuilt the automator script and compiled to .APP and re-tested. @patrix is correct in that the script does only execute upon initial login and not on subsequent unlocking of the system due to inactivity. I am not sure why it was doing so previously but the issue is resolved.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .