Last active
September 9, 2018 14:27
-
-
Save yy/7d679e13d78df581d498ef9f3dbd8782 to your computer and use it in GitHub Desktop.
Create an Omnifocus project from a template file (the first argument). The variables should be written as: `{variable}`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import re | |
import sys | |
if __name__ == "__main__": | |
template_path = sys.argv[1] | |
content = open(template_path).read() | |
var_pattern = re.compile('{.+?}') | |
variables = set(re.findall(var_pattern, content)) | |
for var in variables: | |
var_str = input(f'{var}? ') | |
content = re.sub(var, var_str, content) | |
print(content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On a Mac, one can run
to copy the result to the clipboard, which can then be pasted to OmniFocus.
An example template file:
TaskPaper format reference: https://support.omnigroup.com/omnifocus-taskpaper-reference/