I am making a python script that executes when you log in. I would like to execute it when the user logs in locally. It says welcome and bla bla bla, but it also reads the number of unread emails and reads the first three subjects aloud. Is there any way that I can execute it when the user logs in?
-
http://www.google.com/search?q=osx+execute+it+when+the+user+logs+in – Karoly Horvath Jan 25 '14 at 19:48
1 Answers
You're asking a compound question.
Your first question is really How can I open a program/run a script when a user logs in?
The answer is that it depends on which version of OS X you're using.
This used to be done via a "login hook" pre 10.5. Now, the most straight forward way to do that might be using the OS X login items menu, but I'm pretty sure that doesn't fire on every login event, unless a user was previous logged out.
For example: user A logs in (login event triggered for A), then user B logs in (login event triggered for B), then user A logs back in (no login event triggered for A).
That thing that you run at login could be 100% python, or maybe you mix in some Applescript or something like that.
Here's another question with a detailed answer for OS X 10.6. Running script upon login mac
Here's another answer with some other details: https://superuser.com/questions/295924/how-to-run-a-script-at-login-logout-in-os-x
Looks like you should search for how to use launchd
on your OS X system.

- 1
- 1

- 313
- 3
- 15