Bear Inbox Import
Bear Inbox Import - v. 1.4.4 - 2024-11-11 at 18:16 EST
Here is a workflow where you can paste files into a folder (Bear Inbox) on Mac, iPad, iPhone, Windows (synced by iCloud Drive or Dropbox to a Mac) or Linux (synced by Dropbox to a Mac). They will then appear in Bear as notes (if plain text) or as notes with file attachments (if other kind of files).
Shortcut
Download and install: Bear Inbox Import - Apple Shortcut
Note! Run shortcut maually on different file types some times, to set permissions before using Automator (explained below)
Features
Files Imported to Bear:
All imported notes get tagged with #.inbox
- Plain text files (.txt, .md, markdown) are all imported as regular Bear Notes
- Images into single note (when several are posted together)
- Files like .textbundle, .textpack, .bear, .panda are imported as Bear Notes with images and attachments.
- All other files are embedded as file attachents (several in same note, if posted together)
Run automatically with Folder Actions in Automator on MacOS only (see below).
Or run manually on Mac, iPad or iPhone.
Create and set inbox folder Bear Inbox on either:
- iCloud Drive (Mac, iPad, and iPhone)
- Dropbox (Mac only)
- Google Drive (Mac only)
- Other folders – Local or Cloud synced (Mac only)
Bear Inbox Import - Apple Shortcut
Note: When using iCloud Drive, this shortcut will work manually or scheduled on iPad and iPhone as well.
Automator Folder Action
This will monitor the “Bear Inbox” folder and trigger the shortcut.
- Open Automator and create a new
Folder Action
:
- Chose folder: “Bear Inbox” (same folder as the Shortcut above uses
(on iCloud, other cloud or local HD) - Add action:
Run Shell Script
and choose Shell:python3
(delete default code)
- Copy and paste the Python code below to the
Run Shell Script
action above:
import os
import time
from pathlib import Path
home = str(Path.home())
lock_file = home + '/Library/Mobile Documents/com~apple~CloudDocs/Bear Inbox/lockfile.log'
if os.path.exists(lock_file):
pass
else:
# file_path does not exist
with open(lock_file, 'w') as file:
file.write('Block multi run of shortcut!')
time.sleep(10)
os.system('shortcuts run "Bear Inbox Import"')
# The "Bear Inbox Import" Shortcut will delete
# 'lockfile.log' at the end of run
- Save as
Bear Inbox.workflow
:
- “Throw” any file into the Bear Inbox folder and see how it runs
Comments
If you want to run this shortcut/workflow on a different folder than “Bear Inbox” on “iCloud/”, you have to change to a new path in:
- Bear Inbox Import - Shortcut,
- Automator Folder Action
- and the path for the
lock_file
in Python Code