{"id":13728084,"url":"https://github.com/brandonpittman/OmniFocus","last_synced_at":"2025-05-08T00:31:04.477Z","repository":{"id":74863189,"uuid":"13039307","full_name":"brandonpittman/OmniFocus","owner":"brandonpittman","description":"Scripts for OmniFocus","archived":true,"fork":false,"pushed_at":"2020-05-25T04:37:52.000Z","size":4606,"stargazers_count":326,"open_issues_count":0,"forks_count":30,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-08-04T02:07:48.234Z","etag":null,"topics":["applescript","javascript","omnifocus","omnifocus-library","parse","productivity"],"latest_commit_sha":null,"homepage":"http://blp.is/focusing","language":"AppleScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brandonpittman.png","metadata":{"files":{"readme":"README.md","changelog":"Change OmniFocus Preferences/Change OmniFocus Preferences.scpt","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-09-23T15:21:22.000Z","updated_at":"2024-05-22T03:55:11.000Z","dependencies_parsed_at":"2023-06-29T02:45:13.215Z","dependency_job_id":null,"html_url":"https://github.com/brandonpittman/OmniFocus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandonpittman%2FOmniFocus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandonpittman%2FOmniFocus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandonpittman%2FOmniFocus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandonpittman%2FOmniFocus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brandonpittman","download_url":"https://codeload.github.com/brandonpittman/OmniFocus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224679809,"owners_count":17351872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["applescript","javascript","omnifocus","omnifocus-library","parse","productivity"],"created_at":"2024-08-03T02:00:37.022Z","updated_at":"2024-11-14T19:30:36.834Z","avatar_url":"https://github.com/brandonpittman.png","language":"AppleScript","funding_links":["https://www.buymeacoffee.com/blp"],"categories":["AppleScript"],"sub_categories":[],"readme":"# OmniFocus Library\n\n## Notices\n\n- 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.\n- Probably any script in this repo will require the library. Assume you need it.\n\n## Why is there a new OmniFocus library?\n\nI 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.\n\n- **[Download the library](https://github.com/brandonpittman/OmniFocus/blob/master/OmniFocus%20Library/omnifocus.scpt?raw=true)**\n- **[Browse the repo Github](https://github.com/brandonpittman/OmniFocus)**\n\n## Basic Usage\n\nPut *omnifocus.scpt* in `~/Library/Script Libraries`, or else AppleScript won't know where to find it!\n\n~~~applescript\nuse application \"OmniFocus\"\nuse O : script \"omnifocus\"\n\ntell O\n   set sel to selectedItems()\n   deferDaily(sel)  # this will set all the selected tasks to start again after completion daily\n   setDefer(sel, current date)\n\n   set theTask to findTask(\"Log food\") # find the first task whose name is \"Log food\"\n   set theProject to findProject(\"Groceries\")\n   set theContext to findContext(\"Home\")\n   set theFolder to findFolder(\"Routine\")\n\n   # Parse using transport text (see below for details)\n   parse(\"Do something! @home ::misc #5pm #tomorrow //This is a note\")\nend\n~~~\n\n## Transport Text\n\nFor those who don't know about transport text, it's a format that OmniFocus uses to parse task information like so:\n\n`Do something! @home ::misc #5pm #tomorrow //This is a note`\n\nThe `!` 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.\n\n## Functions\n\n```applescript\n- selectedItems()\n- parse(transportText)\n- findContext(contextName)\n- findProject(projectName)\n- findFolder(folderName)\n- findTask(taskName)\n- allTasks()\n- allProjects()\n- allContexts()\n- setDue(input, dueDate)\n- setDefer(input, deferDate)\n- setProject(input, projectName)\n- setContext(input, contextName)\n- namePrepend(input, prependString)\n- nameAppend(input, appendString)\n- inboxTasks()\n- setComplete(input, booleanFlag)\n- setSequential(input, booleanFlag)\n- openPerspective(perspectiveName)\n- inboxCount()\n- errandsCount()\n- landAndSeaCount()\n- routineCount()\n- computerName()\n- setRepeat(input, repetitionRule)\n- deferDaily(input)\n- deferWeekly(input)\n- deferMonthly(input)\n- repeatDaily(input)\n- repeatWeekly(input)\n- repeatMonthly(input)\n- clearRepeat(input)\n- clearDefer(input)\n- clearContainer(input) *Only works on inbox tasks.*\n- clearContext(input)\n- setOnHold(input)\n- setActive(input)\n- showAbout()\n- toggleColon(input)\n- setColon(input)\n- clearColon(input)\n- setPrefix(input, prefix)\n- clearPrefix(input, prefix)\n- clearPrefixAll(input)\n- setConsider(input)\n- clearConsider(input)\n- toggleConsider(input)\n- kindOf(input) *This will be a task, project, context or folder.*\n- isProject(input)\n- isContext(input)\n- isTask(input)\n- isFolder(input)\n```\n\n\u003ca href=\"https://www.buymeacoffee.com/blp\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-blue.png\" alt=\"Buy Me A Coffee\" style=\"height: 51px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandonpittman%2FOmniFocus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrandonpittman%2FOmniFocus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandonpittman%2FOmniFocus/lists"}