• This repository has been archived on 15/Jun/2022
  • Stars
    star
    328
  • Rank 127,593 (Top 3 %)
  • Language AppleScript
  • Created almost 11 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Scripts for OmniFocus

OmniFocus Library

Notices

  • It's possible that some of these scripts may not work correctly with OmniFocus 3 (as they were all written before OF3 was released). Feel free to let me know if you find anything not working. Pull requests are welcomed.
  • Probably any script in this repo will require the library. Assume you need it.

Why is there a new OmniFocus library?

I had previously written an OmniFocus library using JavaScript for Automation, but it's got issues that vanilla AppleScript does not. Also, I realized that I didn't really need the fancy regex abilities from JavaScript that I thought I needed, so I went back to standard AppleScript. It works just as well, and the source code is a lot more readable. I hope you find this new library useful.

Basic Usage

Put omnifocus.scpt in ~/Library/Script Libraries, or else AppleScript won't know where to find it!

use application "OmniFocus"
use O : script "omnifocus"

tell O
   set sel to selectedItems()
   deferDaily(sel)  # this will set all the selected tasks to start again after completion daily
   setDefer(sel, current date)

   set theTask to findTask("Log food") # find the first task whose name is "Log food"
   set theProject to findProject("Groceries")
   set theContext to findContext("Home")
   set theFolder to findFolder("Routine")

   # Parse using transport text (see below for details)
   parse("Do something! @home ::misc #5pm #tomorrow //This is a note")
end

Transport Text

For those who don't know about transport text, it's a format that OmniFocus uses to parse task information like so:

Do something! @home ::misc #5pm #tomorrow //This is a note

The ! makes Do something a flagged task. @home sets the context to "home". :: is used for matching a project. Both @ and :: will fuzzy match existing contexts and projects. The first # is used for a defer date, while the second # is for a due date. Both support natural language parsing like the inspector in OmniFocus. Word of caution though, if only one # is present, OmniFocus assumes it's a due date. Lastly, // starts the note for a task. While more involved ways of creating OmniFocus tasks exist in the library, you'll find using of.parse as your primary means of creating tasks.

Functions

- selectedItems()
- parse(transportText)
- findContext(contextName)
- findProject(projectName)
- findFolder(folderName)
- findTask(taskName)
- allTasks()
- allProjects()
- allContexts()
- setDue(input, dueDate)
- setDefer(input, deferDate)
- setProject(input, projectName)
- setContext(input, contextName)
- namePrepend(input, prependString)
- nameAppend(input, appendString)
- inboxTasks()
- setComplete(input, booleanFlag)
- setSequential(input, booleanFlag)
- openPerspective(perspectiveName)
- inboxCount()
- errandsCount()
- landAndSeaCount()
- routineCount()
- computerName()
- setRepeat(input, repetitionRule)
- deferDaily(input)
- deferWeekly(input)
- deferMonthly(input)
- repeatDaily(input)
- repeatWeekly(input)
- repeatMonthly(input)
- clearRepeat(input)
- clearDefer(input)
- clearContainer(input) *Only works on inbox tasks.*
- clearContext(input)
- setOnHold(input)
- setActive(input)
- showAbout()
- toggleColon(input)
- setColon(input)
- clearColon(input)
- setPrefix(input, prefix)
- clearPrefix(input, prefix)
- clearPrefixAll(input)
- setConsider(input)
- clearConsider(input)
- toggleConsider(input)
- kindOf(input) *This will be a task, project, context or folder.*
- isProject(input)
- isContext(input)
- isTask(input)
- isFolder(input)

Buy Me A Coffee

More Repositories

1

gridsome-plugin-tailwindcss

A Tailwind plugin for Gridsome.
JavaScript
103
star
2

tailwindcss-plugin-fancy

All the Tailwind plugins that should be in the core package.
TypeScript
43
star
3

gridsome-plugin-tailwindcss-ffs

Sample Gridsome app with TailwindCSS.
Vue
14
star
4

remix-pages-context

A module to make using Cloudflare Pages environment variables and KV-backed sessions easier with Remix.
TypeScript
14
star
5

gridsome-plugin-svg

Super simple SVG component support for Gridsome
JavaScript
9
star
6

gridsome-plugin-ogp

Quickly and easily add common OGP tags for Google, Facebook, and Twitter.
JavaScript
8
star
7

tailwindcss-plugin-delight

Delightful components for your Tailwind project.
JavaScript
7
star
8

gridsome-plugin-purgecss

A Tailwind-friendly Purgecss plugin for Gridsome.
JavaScript
7
star
9

tailwindy

Tailwindy - the Eleventy + Tailwind CSS starter
HTML
5
star
10

qwik-markdown

Helper CLIs for dealing with Markdown routes in Qwik City apps.
TypeScript
4
star
11

businesscard

JavaScript
3
star
12

ldgr

A CLI for working with Ledger files
Ruby
3
star
13

remix-fathom

React Hook to use Fathom in Remix.
TypeScript
3
star
14

simple-setup

My usual repo setup for TypeScript/JavaScript.
TypeScript
2
star
15

purify-invariant

An invariant utility for use alongside purify-ts.
TypeScript
2
star
16

gridtastic

A suite of helpers to augment the Gridsome CLI.
TypeScript
2
star
17

gridsome-plugin-typed

Use TypeScript and TSX in your Gridsome project.
JavaScript
2
star
18

brandonpittman

Brandon Pittman as a Service
JavaScript
2
star
19

stocker

Keep an inventory of things.
Ruby
2
star
20

gridsome-plugin-fathom

Quickly set up Fathom Analytics in your Gridsome project.
JavaScript
2
star
21

formkeep

A library for interacting with the Formkeep API.
Ruby
2
star
22

qwik-bytes

Qwik Bytes examples
TypeScript
1
star
23

gridsome-starter-slides

Gridsome starter for slideshow presentation
Vue
1
star
24

nikki

Record something new learned every day of the year.
Ruby
1
star
25

use-dismiss

The useDismiss() hook for React takes a callback, returns a ref, and invokes the callback when a click event occurs outside the ref's bounds, when the escape key is pressed, or both.
JavaScript
1
star
26

threejs-journey

1
star
27

hooks

Handy hooks I may or may not need in any React project.
TypeScript
1
star
28

use-idb-keyval

React hook to help you use IndexedDB.
TypeScript
1
star
29

site

Brandon's homepage.
TypeScript
1
star
30

tailwindcss-plugin-zeit

CSS
1
star