i use this workflow really well.
thanks for develop this.
nowdays i need to use priority function.
so i try to use priority and it always set high priority.
i am not sure. it cuz of 'Big sur' (i just update)
i search how to fix it and couldn't find.
so try to see the script.
and i got some information.
the script priority value is 1,2,3 but it should 1,5,9(high, med, low)
so anyone get this problem, try to edit script filter
sorry if this is duplicate issue.
env : MacOS Big Sur 11.0.1 (20B29)
...
if(options['priority']) {
switch(parseInt(options['priority'])) {
case 0:
break;
case 9:
title += " (low priority)"
subtitle += " (low priority)"
break;
case 5:
title += " (medium priority)"
subtitle += " (medium priority)"
break;
case 1:
title += " (high priority)"
subtitle += " (high priority)"
break;
}
}
...
// extract priority
var priority = "";
// test for !, !!, !!! at beginning
// http://regexr.com/3er7r
var priorityRegex = /^(!{1,3})\s(.+)/i
var matches = priorityRegex.exec(query)
if(matches && matches.length == 3) {
priority = 9-(matches[1].length-1)*4;
query = matches[2];
} else {
// test for !, !!, !!! at end
// http://regexr.com/3er7u
var priorityRegex = /(.+)\s(!{1,3})$/i
var matches = priorityRegex.exec(query)
if(matches && matches.length == 3) {
priority = 9-(matches[2].length-1)*4;
query = matches[1];
} else {
// test for !3, p1, priority 1, etc
// http://regexr.com/3er73
var priorityRegex = /(.+)\s(priority|p|!)\s*([1-3])\s*$/i
var matches = priorityRegex.exec(query)
if(matches && matches.length == 4) {
priority = 9-(matches[3]-1)*4;
query = matches[1];
} else {
// test for !hi, p med, priority low, etc
// http://regexr.com/3er7c
var priorityRegex = /(.+)\s(priority\s+|p\s*|!\s*)(l|lo|low|m|med|medium|h|hi|high)\s*$/i
var matches = priorityRegex.exec(query)
if(matches && matches.length == 4) {
priorityText = matches[3];
if(priorityText[0]=="l") priority = 9;
else if(priorityText[0]=="m") priority = 5;
else if(priorityText[0]=="h") priority = 1;
query = matches[1];
} else {
// test for hi!, med p, low priority, etc
// http://regexr.com/3er7i
var priorityRegex = /(.+)\s(l|lo|low|m|med|medium|h|hi|high)(\s+priority|\s*p|\s*!)\s*$/i
var matches = priorityRegex.exec(query)
if(matches && matches.length == 4) {
priorityText = matches[2];
if(priorityText[0]=="l") priority = 9;
else if(priorityText[0]=="m") priority = 5;
else if(priorityText[0]=="h") priority = 1;
query = matches[1];
}
}
}
}
}
...