-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ add 'Move To Action Group In Folder (Skip Project Selection)'
- Loading branch information
Showing
6 changed files
with
72 additions
and
23 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
MoveToActionGroup.omnifocusjs/Resources/en.lproj/moveToActionGroupInFolderSkipProj.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,4 @@ | ||
"label" = "Move to Action Group In Folder (Skip Project Selection)"; | ||
"shortLabel" = "Move to Action Group In Folder (Skip Project Selection)"; | ||
"mediumLabel" = "Move to Action Group In Folder (Skip Project Selection)"; | ||
"longLabel" = "Move to Action Group In Folder (Skip Project Selection)"; |
16 changes: 16 additions & 0 deletions
16
MoveToActionGroup.omnifocusjs/Resources/moveToActionGroupInFolderSkipProj.js
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,16 @@ | ||
(() => { | ||
const action = new PlugIn.Action(async (selection) => { | ||
const lib = this.libraries[0]; | ||
const tasks = [...selection.tasks, ...selection.projects.map(project => project.task)]; | ||
await lib.processTasks(tasks, false, true); | ||
}); | ||
action.validate = (selection) => { | ||
// valid if tasks are selected and they all belong to the same project/assigned project | ||
const tasks = [...selection.tasks, ...selection.projects.map(project => project.task)]; | ||
if (tasks.length == 0) | ||
return false; | ||
else | ||
return true; | ||
}; | ||
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
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
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,21 @@ | ||
(() => { | ||
const action = new PlugIn.Action(async (selection: Selection) => { | ||
|
||
const lib = this.libraries[0] | ||
const tasks = [...selection.tasks, ...selection.projects.map(project => project.task)] | ||
|
||
await lib.processTasks(tasks, false, true) | ||
|
||
}) | ||
|
||
action.validate = (selection: Selection) => { | ||
|
||
// valid if tasks are selected and they all belong to the same project/assigned project | ||
const tasks = [...selection.tasks, ...selection.projects.map(project => project.task)] | ||
|
||
if (tasks.length == 0) return false | ||
else return true | ||
} | ||
|
||
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