Hi - I’m trying to delete the default “due” notification that is added to tasks to trigger at their due date with an JavaScript automation:
It seems like the code below (from the Omni Automation website should work, but it doesn’t remove the “due” notification – only “before due” or “scheduled” notifications are removed).
(() => {
var action = new PlugIn.Action(function(selection) {
try {
var sel = selection
var selCount = sel.tasks.length + sel.projects.length
if(selCount > 0){
sel.databaseObjects.forEach(item => {
if(item instanceof Project){
item.task.notifications.forEach(notif => item.task.removeNotification(notif))
} else if (item instanceof Task){
item.notifications.forEach(notif => item.removeNotification(notif))
}
})
} else {
throw {name: "Selection Issue", message: "Please select projects and/or tasks."}
}
}
catch(err){
new Alert(err.name, err.message).show()
}
});
// If needed, uncomment, and add a function that returns true if the current selection is appropriate for the action.
/*
action.validate = function(selection){
};
*/
return action;
})();
Can anyone modify this to remove the “due” notification as well?
Thanks!