bear_import.py
Version 1.0.0 - 2018-02-10 at 17:37 EST
See also: bear_export_sync.py for export with sync-back.
- Imports markdown or textbundles from nested folders under a `BearImport/input/' folder
- Foldernames are converted to Bear tags
- Also imports MacOS file tags as Bear tags
- Imported notes are also tagged with
#.imported/yyyy-MM-dd
for convenience. - Import-files are then cleared to a `BearImport/done/' folder
- Use for email input to Bear with Zapier's "Gmail to Dropbox" zap.
- Or for import of nested groups and sheets from Ulysses, images and keywords included.
- New Automator file as
Folder Action
- Set
Folder action receives files and folders added to
:{user}/Dropbox/BearImport/Input
- Add action:
Run Shell Script
choosebin/bash
- Insert one line with full paths to python and script (Use "" if spaces in paths!):
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 "/Users/username/scripts/bear_import.py"
- Save as
Bear Import
or whatever you choose.
Or skip all this and run it manually :)
- Create a free zapier.com account.
- Use a dedicated gmail account or setup a filter assigning a label used by zapier.
- Make a Zapier zap. See: Add new Gmail emails to Dropbox as text files
- Set zap to monitor inbox with label (assigned by filter in step 2.)
- Set zap Dropbox output to
{user}/Dropbox/BearImport/Input
- Zap will now check for new email (with matching gmail label) every 15 minutes and script above will import to Bear.
- Alternately on iOS: use this workflow (import to Bear from same Dropbox folder): Gmail-DB zap to Bear
- Add
{user}/Dropbox/BearImport/Input
as external folder - Edit folder settings to
.textbundle
andInline Links
! - Drag any library group to this folder in Ulysses' sidebar.
- Voilà – Imports to Bear with images and tags (both from group names and keywords).