Created
May 24, 2012 01:11
-
-
Save davidnunez/2778762 to your computer and use it in GitHub Desktop.
Script that resets Omnifocus project's next review date to a random day in the next week (ex. to distribute review dates across the week)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "OmniFocus" | |
tell document 1 | |
tell (first document window whose index is 1) | |
set SelectedItemInMainView to selected trees of content | |
repeat with i from 1 to (count of SelectedItemInMainView) | |
set theSelectedTask to value of item i of SelectedItemInMainView | |
--display dialog "" & (class of theSelectedTask) | |
if (class of theSelectedTask as string is equal to "project") then set next review date of theSelectedTask to (current date) + days * (random number from 0 to 6) | |
end repeat | |
end tell | |
end tell | |
end tell | |
-- notification of success | |
set the_file to "/System/Library/Sounds/Glass.aiff" | |
set the_file to POSIX file the_file | |
set file_path to quoted form of (POSIX path of (the_file as alias)) | |
do shell script ("afplay " & file_path & " > /dev/null 2>&1 &") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment