Skip to content

Instantly share code, notes, and snippets.

@shedali
shedali / index.js
Last active October 10, 2019 12:53
test grab due tasks with jxa in node
const runJxa = require("run-jxa");
const _ = require('lodash');
(async () => {
const result = await runJxa(() => {
var of = Application("OmniFocus");
var doc = of.defaultDocument;
return getTasks();
@henryroe
henryroe / Save mail attachments with pre-pended YYYY-MM-DD_.kmmacros
Created February 16, 2015 01:50
Keyboard Maestro macro to take Mail.app attachments, pre-pend YYYY-MM-DD_..., and save to user-selected dir
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>IsActive</key>
<true/>
<key>Macros</key>
@keicoder
keicoder / snippet.txt
Created December 18, 2013 12:27
devonthink : 검색 연산자
DevonThink Search operators
In the toolbar search field, as well as in both the interactive and the simple web interface, you can use standard and extended Boolean operators, parenthesis, and more to fine tune your search.
The syntax of the operators is compatible to DEVONagent and EasyFind, the Finder, Spotlight, common search engines as well as common programming languages such as C, C++, Objective-C, Java, and JavaScript. The complexity of the query is unlimited.
Case
All terms are case-insensitive. You may, if you wish, use capitalization for proper names in a query, but DEVONthink Pro Office will ignore case in interpreting the query.
@anjiro
anjiro / trello_days_left.js
Last active October 30, 2019 23:10
Trello show days left Greasemonkey script
// ==UserScript==
// @name Trello days left
// @namespace edu.rit.ashbrook.daniel
// @include https://trello.com/*
// @version 1.1
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant GM_addStyle
// @description Add the number of days left until an item is due to each applicable card.
// ==/UserScript==
@brandonpittman
brandonpittman / omnifocus_javascript.js
Last active March 7, 2020 16:09
Examples for using JavaScript for Automation with OmniFocus
// Here are some examples of using Javascript for Automation with OmniFocus
// Create an inbox task
//
// Here, we call inboxTasks without parens because we want it as a function to call later
of = Application('OmniFocus')
inbox = of.defaultDocument.inboxTasks
task = of.InboxTask({name: "testing"})
inbox.push(task)
@henryroe
henryroe / Access NSScreen.scpt
Last active March 7, 2021 21:54
Demonstration of how to use an AppleScript Bundle to enable access to NSScreen in AppleScriptObjC
(*
Copy and paste this script into a new document in AppleScript Editor.
When saving, select "Script Bundle" as File Type.
Save the file to: "~/Library/Script Libraries/Access NSScreen.scptd"
Note: you may need to create the directory: "~/Library/Script Libraries"
Note: while this gist has the file ending "scpt", by selecting the
"Script Bundle" file type, the file extension "scptd" should be added.
@jbeda
jbeda / Zoom Macros.kmmacros
Last active May 2, 2021 17:59
Zoom mute/unmute files
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>582833929.55457795</real>
<key>Macros</key>
@ChristoferK
ChristoferK / Centre Window.applescript
Last active November 3, 2022 06:34
[Centre Window on Screen] Centres the frontmost window on screen #AppleScript #SystemEvents #UI #window #position
use application "System Events"
property process : a reference to (first process whose frontmost = true)
property window : a reference to front window of my process
property display : a reference to scroll area 1 of process "Finder"
if not (my window exists) then return
set [width, height] to size of my window
set [screenX, screenY] to size of my display
@RobTrew
RobTrew / jxaClickAppSubMenuItem.applescript
Last active January 16, 2023 20:15
Yosemite JXA Javascript Function for clicking application sub-menu items
// Click an OS X app sub-menu item
// 2nd argument is an array of arbitrary length (exact menu item labels, giving full path)
// e.g. menuItemClick("InqScribe", ['View', 'Aspect Ratio', 'Use Media Ratio'])
// Note that the menu path (spelling & sequence) must be exactly as in the app
// See menuItemTestClick() below for a slower version which reports any errors
// For macOS Yosemite to Sierra
@josephernest
josephernest / daemon.py
Last active March 22, 2023 05:20
Daemon for Python
# From "A simple unix/linux daemon in Python" by Sander Marechal
# See http://stackoverflow.com/a/473702/1422096 and http://web.archive.org/web/20131017130434/http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
#
# Modified to add quit() that allows to run some code before closing the daemon
# See http://stackoverflow.com/a/40423758/1422096
#
# Modified for Python 3 (see also: http://web.archive.org/web/20131017130434/http://www.jejik.com/files/examples/daemon3x.py)
#
# Joseph Ernest, 20200507_1220