Skip to content

Instantly share code, notes, and snippets.

@julienma
Last active September 23, 2018 08:41
Show Gist options
  • Save julienma/61e05bb025f2a35efc9992abe44711ba to your computer and use it in GitHub Desktop.
Save julienma/61e05bb025f2a35efc9992abe44711ba to your computer and use it in GitHub Desktop.
DO Note to Omnifocus inbox
(*
Author: Julien Ma - https://github.com/julienma
This script creates a new task in Omnifocus inbox, parsing a text file's content to create the task.
I use it to quickly create tasks from Android, using IFTTT's DO Note widget.
Installation (on the computer where you use Omnifocus):
- Setup this IFTTT applet: https://ifttt.com/applets/47483145d-send-to-omnifocus
(Basically a DO Note to a Dropbox folder, with the note as the file content)
- Put a copy of the script in /Library/Scripts/Folder Action Scripts or ~/Library/Scripts/Folder Action Scripts.
- Right-click on the target folder in Dropbox > Services > Folder Actions: enable folder actions and select this script.
Usage:
- Create a new note on your phone with the DO Note widget. The note will be the task title. You can use the Omnifocus parse syntax for more advanced control.
- If both your phone and computer have an updated Dropbox, a new task will be created in your Omnifocus inbox.
Content will be parsed by Omnifocus:
cf. https://github.com/brandonpittman/OmniFocus#transport-text
E.g.: "my task title! #2days @my_context //some comment"
*)
on adding folder items to this_folder after receiving added_items
tell application "OmniFocus"
repeat with i from 1 to number of items in added_items
set new_item to item i of added_items
set actionTitle to "New from android: " & (read new_item)
parse tasks into default document with transport text actionTitle
end repeat
end tell
tell application "Finder" to delete added_items
end adding folder items to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment