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?
-
What sort of action are you trying to make happen?– Tony TellezCommented 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.– JoshCommented Oct 10, 2012 at 0:30
2 Answers
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.
-
Thanks for your reply but that's a bit advanced for me… Could you possibly break it down a little for me?– JoshCommented Oct 11, 2012 at 14:15
-
-
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.– JoshCommented Oct 12, 2012 at 17:36
-
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