Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jjordanlam

macrumors newbie
Original poster
Jan 22, 2011
2
0
Hello, first of all let me say that I work for a computer security company, and I train our "Virus Fighters."As part of their training I need to make an applescript application that when opened, will first add itself to the user's login items, then shutdown the computer. The aim of this is that whenever the Fighter logs on to their account, the computer turns off. I am planning on doing this when the Fighters leave the office for the night, so that they will wake up to a nice morning challenge. I already have the shutdown command, but I was wondering how to add to some sort of login items when the application runs. Thanks for your help!

P.S. I have already googled it.
 
I think you basically answered your own question.

Create the AppleScript application and save it as an application. Open up the System Preferences, click Accounts, and add the application you created to the user's login items. Or maybe I'm not reading what you want to accomplish correctly, but this all seems very straight forward with just a handful of clicks.
 
P.S. I have already googled it.

And what did you find? How did it not answer your question?

When I google it, I find a decent number of results that show exactly how to do what you ask for. If those aren't what you're looking for, please explain why not.

Google search terms I used:
applescript add login item
 
I am looking for a script that will add istelf to login items automatically, because that's what a client will most likely do. A client will not set up its own virus, because then they could just delete it from login items once they realize what they did. I need something that will do it all once I run the script.
 
Google search terms I used:
applescript add login item

Even though I initially misunderstood what you were trying to do, this google search got me exactly to what you are attempting.... One of the first few links even outlines how to check to see if the item already exists and add it if it doesn't. I highly assume that running this as described would also cause a password popup to occur, so it wouldn't be entirely automagic.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.