Super User is a question and answer site for computer enthusiasts and power users. 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 am trying to setup a watch folder so that when a file is added to a folder, I can run a shell script...for this purpose I made a simple test but cannot make it work...

Here is my applescript

on adding folder items to theWatchedFolder after receiving theDetectedItems
    display dialog "Transcode Successful"
    do shell script "/Users/wme/Desktop/" & theDetectedItems
end adding folder items to

and the

    name=$(basename "$f")
    dir=$(dirname "$f")
    notify-send "$name"

While it does alert me "Transcode Successful" So I do know that the applescript is working...I dont get notified via the shellscript that the correct filename has do I do that?

share|improve this question
on adding folder items to p after receiving input
    set l to {}
    repeat with f in input
        set end of l to quoted form of POSIX path of f
    end repeat
    set text item delimiters to " "
    do shell script "bash ~/Desktop/ " & (l as text)
end adding folder items to

You can also use Automator to create folder actions that run shell scripts directly:

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.