3
I'm editing a note, then I get a call from my ADHD and I go to look at another note. Is there no way to get back to the previous note? I'm looking for previous/next like in a browser (or any other program, these days)...
3
I'm editing a note, then I get a call from my ADHD and I go to look at another note. Is there no way to get back to the previous note? I'm looking for previous/next like in a browser (or any other program, these days)...
2
The developer of Notational Velocity in a comment to #64: Simple: Jump back to last note, Advanced: Browsing history - Issues - scrod/nv - GitHub:
How would NV determine what the "last" note was? Would that be the last note edited? The last note where the editor had focus? The last note selected? How would it differentiate between selecting a series of notes using Command-J/K, the left/right keys, or dragging across them with the mouse?
I've tried writing AppleScripts that were based on the modification date of the external text files for notes. But that had a few additional issues, and the scripts were pretty unintuitive to use.
The best workaround I've come up with:
tell application "System Events" to tell process "nvALT"
set p to value of text field 1 of group 1 of tool bar 1 of window 1
end tell
set x to do shell script "cd /1
/bin/ls -t |
grep -v '^Interim Note-Changes$' |
grep -v '^Notes & Settings$' |
grep '^'" & quoted form of p & "'.txt$' -B 1 |
grep -v '^'" & quoted form of p & "'.txt$' |
sed 's|\\.txt$||'"
open location "nv://" & x
delay 0.1
tell application "System Events" to keystroke return
NV doesn't save changes to external files immediately. (It takes about 5 to 10 seconds from the first edit.) Most of the time that's not a problem though.
Another (and probably the best) option would be to sort Notational Velocity's note list by Date Modified. Then for example pressing ⎋↓↓↩ would go to the second most recently modified note.
Thanks @Lri, great answer. So all of these depend on you actually modify the notes, right? – Dan Rosenstark – 2011-10-23T15:37:19.823
@Yar Yeah. You can't sort by "date last opened" in NV. And the external files don't have any metadata for that either. – Lri – 2011-10-23T20:06:00.480
1Thanks @Lri, that make sense... were I building (or modifying) NV, I definitely would not make that data persistent. It would just be a stack of the notes that have shown up in the editing pane. – Dan Rosenstark – 2011-10-23T21:34:25.370
1
I've done something fairly similar, but rely on the last added attribute of a directory rather than the Note and Settings file, since it can be slow to update. Here's a quick script you can take advantage of with any directory
FOLDER="$HOME/Dropbox/My Notes"
RECENT=$(mdls -name kMDItemFSName -name kMDItemDateAdded $FOLDER/* | \
sed 'N;s/\n//' | \
awk '{print $3 " " $4 " " substr($0,index($0,$7))}' | \
sort -r | \
cut -d'"' -f2 | \
head -n1)
FULLPATH="$FOLDER/$RECENT"
Now you can open NVAlt or reveal the file with
# Open in NVAlt
open "nvalt://$RECENT"
# Reveal in Finder
open -R "$FULLPATH"
You could try abusing the bookmarks feature to store what note you're viewing, then return later and remove from bookmarks. – Daniel Beck – 2011-10-23T02:57:21.330
Thanks @DanielBeck, my concern is that I usually realize that I want to go back AFTER I've gone forward :) – Dan Rosenstark – 2011-10-23T17:39:18.283