-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOmniFocus Planning.js
More file actions
49 lines (47 loc) · 1.82 KB
/
OmniFocus Planning.js
File metadata and controls
49 lines (47 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: purple; icon-glyph: stream;
const MENU = [
{name: 'Perspectives', title: true},
{name: 'Available', perspective: 'Available'},
{name: 'Calendar', perspective: 'Calendar'},
{name: 'Due Soon', perspective: 'Due Soon'},
{name: 'Forecast', builtIn: 'forecast'},
{name: 'Inbox', builtIn: 'inbox'},
//{name: 'Morning', perspective: 'Morning'},
{name: 'Morning H', perspective: 'Morning H'},
{name: 'Refiling', perspective: 'Refiling'},
{name: 'Review', perspective: 'Review'},
{name: 'Review - Built In', builtIn: 'review'},
{name: 'Someday', perspective: 'Someday'},
{name: 'Today', perspective: 'Today'},
{name: 'Up Next', perspective: 'Up Next'},
{name: 'Waiting', perspective: 'Waiting'},
{name: 'Triggers', perspective: 'Triggers'},
{name: 'Templates', title: true},
{name: 'Daily Planning', task: 'bYC23KS953g'},
{name: 'Work Day', task: 'iTviqZb9m8B'},
{name: 'Weekly Review', task: 'lEejXeknDyP'},
{name: 'Monthly Review', task: 'fqWsysXqmXI'},
];
const table = new UITable();
for(let i = 0; i < MENU.length; i++) {
let item = MENU[i];
let row = new UITableRow();
let cell = row.addText(item.name);
row.isHeader = item.title == true;
row.dismissOnSelect = false;
row.onSelect = (number) => {
if (item.url) {
Safari.open(item.url);
} else if (item.perspective) {
Safari.open('omnifocus:///perspective/' + encodeURI(item.perspective));
} else if (item.builtIn) {
Safari.open('omnifocus:///' + encodeURI(item.builtIn));
} else if (item.task) {
Safari.open('omnifocus:///task/' + encodeURI(item.task));
}
}
table.addRow(row);
}
QuickLook.present(table);