Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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 '12 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? – patrix Sep 17 '12 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 '12 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 '12 at 15:17
Do you logout the user after inactivity? Login items don't get re-executed if you just enter the screensaver password. – patrix Sep 17 '12 at 15:18
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer


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.