Bear: Opening Random Notes
- A simple Python script that selects and opens a random Bear note.
- Tested on macOS Catalina, with Bear version 1.7.10.
- Breakdown:
- Identify the Bear database location.
- Execute the SQLite command for selecting a random note.
- The function
RAND()
generates a random value for each row in the table. - The
ORDER BY
clause sorts all rows in the table by the random number generated with theRAND()
function. - The
LIMIT
clause picks the first row in the result.
- The function
- Open the note using Bear’s callback URL.
1 | #!/usr/bin/env python3 |