Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c118efd
commit 4ad4b93
Showing
5 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"use strict"; | ||
(() => { | ||
var action = new PlugIn.Action(async (selection) => { | ||
try { | ||
let originalTask = selection.tasks[0]; | ||
originalTask.flagged = false; | ||
let followUp = new Task(`follow up for review on "${originalTask.name}"`, originalTask); | ||
let when = new Date(); | ||
when.setDate(when.getDate() + 1); | ||
// make sure we're not following up on a weekend | ||
while (when.getDay() > 5) { | ||
when.setDate(when.getDate() + 1); | ||
} | ||
// now that we've adjusted the date, set the correct time to defer | ||
when.setHours(9); | ||
when.setMinutes(0); | ||
when.setSeconds(0); | ||
when.setMilliseconds(0); | ||
followUp.deferDate = when; | ||
} | ||
catch (err) { | ||
console.error(err); | ||
throw err; | ||
} | ||
}); | ||
action.validate = function (selection) { | ||
return selection.tasks.length === 1; | ||
}; | ||
return action; | ||
})(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
(() => { | ||
var action = new PlugIn.Action(async (selection: Selection) => { | ||
try { | ||
let originalTask: Task = selection.tasks[0]; | ||
originalTask.flagged = false; | ||
|
||
let followUp = new Task( | ||
`follow up for review on "${originalTask.name}"`, | ||
originalTask | ||
); | ||
|
||
let when = new Date(); | ||
when.setDate(when.getDate() + 1); | ||
|
||
// make sure we're not following up on a weekend | ||
while (when.getDay() > 5) { | ||
when.setDate(when.getDate() + 1); | ||
} | ||
|
||
// now that we've adjusted the date, set the correct time to defer | ||
when.setHours(9); | ||
when.setMinutes(0); | ||
when.setSeconds(0); | ||
when.setMilliseconds(0); | ||
|
||
followUp.deferDate = when; | ||
} catch (err) { | ||
console.error(err); | ||
throw err; | ||
} | ||
}); | ||
|
||
action.validate = function (selection: Selection) { | ||
return selection.tasks.length === 1; | ||
}; | ||
|
||
return action; | ||
})(); |
5 changes: 5 additions & 0 deletions
5
AwaitReview.omnifocusjs/Resources/en.lproj/awaitReview.strings
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"label" = "Await review"; | ||
"shortLabel" = "Await"; | ||
"mediumLabel" = "Await review"; | ||
"longLabel" = "Await review"; | ||
"paletteLabel" = "Await"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"zone.bytes.awaitReview" = "Await review"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"author": "Brian Hicks", | ||
"identifier": "zone.bytes.awaitReview", | ||
"defaultLocale": "en", | ||
"version": "1.0", | ||
"description": "Await Review", | ||
"actions": [ | ||
{ | ||
"identifier": "awaitReview", | ||
"image": "eyes" | ||
} | ||
] | ||
} |