A Hack to Index Notes, for Quicksilver
First: A few presumptions; this is a hack:
- You have at least some grasp of operating at the (Mac) command-line; ex: in Terminal.
- For instance:
~
(tilde) is an abbreviation is for your homedir.
- For instance:
- You know what Quicksilver is.
- (Yes; Far as I know, it’s Mac only.)
- Debugging your setup is up to you; at the moment, I have extremely limited availability to help.
- Feel free to drop a note; on the off chance it’s possible, I will try to help.
How to set it up
- A (bash) script to list the Titles of your Notes:
- The code is in separate section below.
- Save the script to
~/dump-note-titles.sh
. chmod
it, to be executable:chmod u+x ~/dump-note-titles.sh
- Run it once, to seed the output file:
~/dump-note-titles.sh
- Open the
~/titles-from-notes-app.txt
file which it generated.- It should have a list of the Titles of your Notes.
- Keep this up-to-date, via cron:
- Edit your crontab:
crontab -e
- Add a line like this:
48 * * * * ~/dump-note-titles.sh
- Yes; cron can be a bear to debug. :/
- Edit your crontab:
- Config QuickSilver to use this new “index”:
- Add a Catalog entry, using
File & Folder Scanner
. - For the Path, select the
~/titles-from-notes-app.txt
file generated by the script above. - For the Include Contents setting, select
Text Lines
.
- Add a Catalog entry, using
- Config a new Quicksilver Action, to open Notes by title:
- Open
Script Editor.app
. - Paste the code in - see the separate section below.
- Save it, as
open note by title.scpt
(File format: Script
), to your Quicksilver Actions directory.- Which is usually here:
~/Library/Application Support/Quicksilver/Actions/
.
- Which is usually here:
- Open
How to use
- Fire up Quicksilver.
- Start typing some substring of a Note Title.
- Select the Title you want from the results.
- Select
open note by title
as the action.
bash Script ~/dump-note-titles.sh
#!/bin/bash
osascript \
-e 'set outFilePath to (((path to home folder) as text) & "titles-from-notes-app.txt")' \
-e 'tell application "Notes"' \
-e 'set nameList to name of every note' \
-e 'end tell' \
-e 'set outFile to open for access file outFilePath with write permission' \
-e 'repeat with theName in nameList' \
-e 'write theName & return to outFile as «class utf8»' \
-e 'end repeat' \
-e 'close access outFile' \
Applescript open note by title.scpt
using terms from application "Quicksilver"
on process text ThisClipping
tell application "Notes"
show note ThisClipping
end process text
end using terms from
(Yes; I do intend to put this in a repo, where it belongs.)