The Mac Observer

Skip navigational links

Featured Article: Podcast - Mac Geek Gab #158: Bad RAM, iSights, Drive Speeds, and Startup Shortcuts

TMO Quick Tip - Monitor Your Mac with Folder Actions

by , 7:30 AM EST, February 20th, 2006

Some application installers add items to your Library folder that you may not want to have, and there is the possibility that someone could try to trick you into installing something you would rather not have on your computer. With a little help from Mac OS X Folder Actions, you can take a proactive approach to defending your system and files.

Let's add a folder action to your StartupItems directory, so we'll know if any application installers add anything that will launch automatically when your Mac is turned on.

If Folder Actions hasn't already been enabled, we need to do that first. Here's how:

    - Launch Folder Actions Setup. It's in Applications > AppleScript > Folder Actions Setup.
    - Click the Enable Folder Actions check box.
    - Quit Folder Actions Setup.


Make sure Folder Actions are enabled.

Now let's attach the Folder Action to the StartupItems folder:

    - Navigate to your StartupItems folder. It's in the Library folder on your hard drive.
    - Control-Click (Right-Click on a two button mouse) the StartupItems folder and select Attach a Folder Action.
    - Select add - new item alert.scpt (The script should be at the top of the list.), and click the Choose button.


Use the StartupItem's contextual menu to add a folder Action.

Any time an item is added to your StartupItems folder, you'll see an alert dialog that can open the folder and highlight any new items.


The Folder Action Alert dialog.

Feel free to monitor other folders, too. If your Library folder has an InputManagers folder, that's a good one to attach this Folder Action to. Check the Library folder that's in your Home Directory. If you have an InputManagers folder there, be sure to attach this action to it as well.

Observer Comments

Show: Subjects Only | Full Comments
View Name:Guest
Subject: user specific or system wide?
Close Name:Wings Posts: 87 Joined: 30 Mar 2004
Subject: Contextual Menu "Attach" Does Nothing

Probably not the right place to post this, but...

When I right-click on StartupItems folder and choose Attach Folder Action, nothing happens. I have to go to the Folder Actions Setup app and click the "+" button to choose a folder to add an action to. MacOS 10.4.5

Close Name:madgunde Posts: 66 Joined: 02 Dec 2004
Subject: Re: user specific or system wide?

It can be applied to ANY folder you want to watch. The example is targetting the /Library/StartupItems folder, but you could just as easily attach it to ~/Library/StartupItems (if it exists).

If you want to protect against the recent trojan, also apply it to your ~/Library/InputManagers folder and /Library/InputManagers. If those folders don't exist, create them first.

FYI, the tilde "~" indicates your home folder in Unix speak, while paths starting with just a slash "/" are paths beginning from the root of your system.

Close Name:toefats Posts: 3 Joined: 20 Jan 2005
Subject:

Nice but there are more ways than that to make items start with start up.
You need also to monitor your ~/library/loginwindow.plist, and maybe
also /library/preferences/com.apple.loginwindow.plist
and the same file in the ~library/preferences.

HP sticks a start up item in one of those last 2, I've forgotten which, and
it took me a LONG time to find out where it was.

View Name:Guest
Subject:
Close Name:gslusher Posts: 2043 Joined: 13 Nov 2002
Subject: Monitoring startup items

Quote
Guest wrote:
Quote
madgunde wrote:
It can be applied to ANY folder you want to watch.


Sorry, I'll be more specific...it was the action, not the folder I was asking about...if I put a watch on the /library/Input Managers folder, would this flag up a change to whoever was logged in (system wide), or do I have to login and configure the action for each user to get it to do that (user specific)?


There is a startup items folder for each user, so you'd have to monitor each one.

View Name:Guest
Subject:
Comment on this Article


You cannot edit your comments.   You cannot delete your comments.
Log in | Register | Having Problems? Reset TMO Cookies & Try Again
Username:   Password:   Log me on automatically each visit   

You are not logged in, and this post will appear as "Guest." Log in with your username and password from the TMO forums. If you do not have a username, you can register here.
Please note that guests are limited to including a maximum of two URLs per post.


Post A Comment
  Subject


  Your Comments



Please enter the word exactly as you see it in the image above. Registered users aren't prompted for this. Having trouble reading the image get a new one.


Recent Headlines - Updated Friday, July 4th, 2008

Fri., 7:30 AM
Happy Fourth of July!
Thu., 4:50 PM
Apple Slashes $400 from SSD Drive in MacBook Air
4:05 PM
It's Official - Firefox Sets Guinness Record for Downloads
3:30 PM
Apple Files Patent for a Multi-touch Gesture Language
2:20 PM
Editorial - Mac's Market Share and the Cascade Failure of Windows
1:35 PM
iPodObserver - Apple Slurps Up Samsung's NAND Flash for iPhone 3G
1:05 PM
WSJ: Tips for Switching from Windows to Mac
12:05 PM
iPodObserver - Google Intros Google Talk for iPhone
11:35 AM
iPO Just a Thought - iPod nano Versus iPhone: Decisons, Decisions...
10:55 AM
YouTube Ordered to Turn Over All User Records to Viacom
10:10 AM
Hot Forum Topic - Apple vs. Cell Carriers: Who's Winning the Game
9:25 AM
iPodObserver - Rumor: Best Buy, Radio Shack to Sell iPhone 3G
8:45 AM
.Mac Bookmark Sync Deadline Extended to July 6
8:10 AM
Adobe Reader 9 Hits the Streets
 

The Mac Observer Reader Specials

  • Special Report: WWDC 2008
  • Special Report: iPhone
  • __________
  • Help TMO Grow
  • Podcast: Mac Geek Gab
  • Podcast: Apple Weekly Report
  • TMO on Twitter!
  • New Media Expo 2008

Apple Stock Quote

  • AAPL: $170.12. Change Today: +1.94.
  • (Prices delayed up to 20 minutes.)
  • Discuss in our Apple Finance Board

Hot Topics

Apple iTunes

Top Deals From DealsOnTheWeb