Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a folder that I would like to add a folder action to. The action works great when the file is added to the top level. But when a file is added to and sub-folders, the action is not enabled. Is there a way to ensure that a folder action is enabled when a file is added to any of its subfolders?

share|improve this question
2  
Folder actions are not recursive . You might have better luck with a utility like Hazel, which hooks into the same events notification interface. –  kopischke Jul 21 '12 at 18:19
    
Thanks, I will check it out! –  biased_estimator Jul 26 '12 at 0:30

2 Answers 2

I could have sworn there's an action that's called"Get Folder Content", with the option "Repeat for each subfolder found". Have you tried that?

share|improve this answer

launchd has a feature called watchpaths which can run a .sh script or whatever you please when changes occur.

depending on the security requirements of paths are you are looking to monitor and when you'd like it monitored (when logged in or always?); determines where you place the plist.

 ~/Library/LaunchAgents         Per-user agents provided by the user.
 /Library/LaunchAgents          Per-user agents provided by the administrator.
 /Library/LaunchDaemons         System-wide daemons provided by the administrator.
 /System/Library/LaunchAgents   Per-user agents provided by Mac OS X.
 /System/Library/LaunchDaemons  System-wide daemons provided by Mac OS X.

Example: ~/Library/LaunchAgents/com.tellemewhen.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
    <string>com.tellemewhen.plist</string>
    <key>OnDemand</key>
    <true/>
    <key>Program</key>
    <string>/PATH/TO/YOURSCIPTTORUN.sh</string>
    <key>ProgramArguments</key>
    <array>
            <string></string>
    </array>
    <key>WatchPaths</key>
    <array>
            <string>/path/to/watch</string>
    </array>
    </dict>
</plist>

launchctl load ~/Library/LaunchAgents/com.tellemewhen.plist loads the plist.

share|improve this answer

Your Answer

 
discard

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.