This file contains hidden or 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
// jshint esversion:6 | |
(function() { | |
var start = new Date().getTime(); | |
var app = Application('OmniFocus'); //This assumes that OmniFocus is installed on MacOS | |
app.includeStandardAdditions = true; | |
var doc = app.defaultDocument; | |
var content = doc.documentWindows.at(0).content; | |
var selectedTree = content.selectedTrees(); | |
var selectedLen = selectedTree.length; |
This file contains hidden or 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
//Also see question and answer at https://discourse.omnigroup.com/t/add-a-new-task-and-set-the-project-it-belongs-to-via-javascript-of3/44111 | |
var app = Application('OmniFocus'); | |
app.includeStandardAdditions = true; | |
var doc = app.defaultDocument; | |
var content = doc.documentWindows.at(0).content; | |
var selectedTree = content.selectedTrees(); | |
var selectedLen = selectedTree.length | |
var proj = null |
This file contains hidden or 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
The PowerPanel for Linux software is major help system to monitor UPS, which support USB and serial port. | |
The pwrstatd program will run as a daemon process, it startups since system is booting. | |
The pwrstatd is major to communicate with UPS and to help system to do graceful shutdown while the power events is aware. | |
The other program called pwrstat, it helps user to get status of the UPS and settings of the pwrstatd daemon. | |
It also allows user to configure the UPS and pwrstatd daemon. |
This file contains hidden or 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
var projName = "My First Auto-created Project"; | |
var app = Application("Omnifocus") | |
app.includeStandardAdditions = true | |
var doc = app.defaultDocument | |
var matchingProjects = doc.flattenedProjects.whose({name: projName}) | |
var theProject = null | |
if (matchingProjects.length == 0) { | |
theProject = app.Project({ | |
name: projName, |
This file contains hidden or 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
//Modified from https://discourse.omnigroup.com/t/creating-a-new-task-with-javascript-for-automation-jxa/22393/2 | |
var app = Application('OmniFocus'); | |
app.includeStandardAdditions = true; | |
var doc = app.defaultDocument; | |
var newTask = app.InboxTask({ | |
name: 'sample task', | |
note: 'a note', | |
}); | |
app.quickEntry.inboxTasks.push(newTask); |
This file contains hidden or 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
var app = Application('OmniFocus'); | |
app.includeStandardAdditions = true; | |
var doc = app.defaultDocument; | |
var content = doc.documentWindows.at(0).content; | |
var selectedTree = content.selectedTrees(); | |
var selectedLen = selectedTree.length | |
if (selectedLen == 0) { | |
//app.displayDialog("Nothing selected in Omnifocus"); | |
} else { |
This file contains hidden or 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
// jshint esversion:6 | |
(function() { | |
var app = Application('OmniFocus'); //This assumes that OmniFocus is installed on MacOS | |
app.includeStandardAdditions = true; | |
var doc = app.defaultDocument; | |
var content = doc.documentWindows.at(0).content; | |
var selectedTree = content.selectedTrees(); | |
var selectedLen = selectedTree.length; |
This file contains hidden or 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
-- Modified from: http://bylr.net/3/2011/07/omnifocus-script-get-total-time-of-selected-items/ | |
on main() | |
tell application "OmniFocus" | |
tell content of first document window of front document | |
--Get selection | |
set totalMinutes to 0 | |
set validSelectedItemsList to value of (selected trees where class of its value is not folder and class of its value is not tag) | |
set totalItems to count of validSelectedItemsList | |
if totalItems is 0 then |
NewerOlder