1

Specifically I'd like to attach a folder action that would pass to the Notification center a timed alert that would go off after 60 days... possible?

2
  • What sort of action are you trying to make happen? Commented Oct 10, 2012 at 0:23
  • I want to set a 60 day reminder automatically. So, 60 days after I save or move something to the folder (with the folder action attached), a reminder notification would pop up.
    – Josh
    Commented Oct 10, 2012 at 0:30

2 Answers 2

1

Enable at:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist

Add a Run Shell Script action that uses terminal-notifier to display a notification:

at 2 months <<< 'terminal-notifier -message "some message" -title "title"'

Replace terminal-notifier with /Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier if you've installed it by downloading the application bundle.

now+5 <<< 'say a' would run a command in five seconds. You can list scheduled commands with atq and remove them with atrm. See man at for more information.

4
  • Thanks for your reply but that's a bit advanced for me… Could you possibly break it down a little for me?
    – Josh
    Commented Oct 11, 2012 at 14:15
  • I edited the answer. You could also use launchd instead of folder actions.
    – Lri
    Commented Oct 11, 2012 at 15:39
  • I got a little help and figured out how to modify an existing applescript I had already attached. I just needed to change a few terms. So the updated script now is: cont.
    – Josh
    Commented Oct 12, 2012 at 17:36
  • Oh crap...no way to save the formatting...
    – Josh
    Commented Oct 12, 2012 at 17:39
1

OK so as it turns out I found the answer to this. I just needed to edit my existing attached applescript. And here is is with the proper formatting in place:

property myList : "Invoices"

on adding folder items to this_folder after receiving these_items
    repeat with this_item in these_items
        set fName to name of (info for this_item)
        if fName does not start with "." then -- avoid new todo for .dsstore files or something similar 
            set startTime to (current date) + 60 * days
            tell application "Reminders"
                make new reminder at beginning of list myList with properties {name:fName, due date:startTime, remind me date:startTime}
            end tell
        end if
    end repeat
end adding folder items to

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .