Skip to content

Instantly share code, notes, and snippets.

@brandonpittman
brandonpittman / activateWeeklyReview.applescript
Last active August 29, 2015 14:14
Duplicate and Activate Weekly Review
tell application "OmniFocus"
tell default document
set p to first flattened project whose name is "Weekly Review"
set theDate to do shell script "date +'%F'"
set p2 to duplicate p to after p
set name of p2 to name of p2 & " " & theDate
set status of p2 to active
if visible of front document window is true then
set perspective name of document window 1 to "Weekly"
else
@brandonpittman
brandonpittman / openNoteAndComplete.js
Last active April 9, 2016 03:03
Complete a task in OmniFocus and open the URL in the note
of = Library('Omnifocus')
sel = of.selected()
app = Application('OmniFocus')
app.includeStandardAdditions = true
system = Application.currentApplication()
system.includeStandardAdditions = true
sel.forEach(function(task) {
of.complete([task])
name = task.name()
tell application "Mail"
set _sel to get selection
set _links to {}
repeat with _msg in _sel
set _messageURL to "message://%3c" & _msg's message id & "%3e"
set end of _links to _messageURL
end repeat
set AppleScript's text item delimiters to return
set the clipboard to (_links as string)
end tell
@andrewh
andrewh / anyconnect.scpt
Last active April 12, 2024 08:48
Applescript to automate the Cisco AnyConnect SSL VPN client on OS X Mavericks
-- 1. Place in ~/Library/Scripts and enable the Applescript menu via the Applescript Editor
-- 2. Substitute "vpn.example.com" and "redacted" for your VPN server and password
-- 3. Open Security & Privacy System Preferences, go to Privacy, Accessibility
-- 4. Enable Applescript Editor and System UI Server
-- 5. Trigger script from the menu
-- 6. Enjoy being connected
tell application "Cisco AnyConnect Secure Mobility Client"
activate
end tell
@jnjosh
jnjosh / OmniFocus-QuickEntry.applescript
Created January 27, 2013 01:16
Applescript to show the OmniFocus Quick Entry
tell application "OmniFocus"
tell quick entry
open
make new inbox task
tell application "System Events" to keystroke tab
activate
end tell
end tell