How to get the path to the archive
Hi, I am still seeking a clean way to get the path to my note, as requested here https://forum.zettelkasten.de/discussion/1401/request-some-way-of-getting-note-file-path#latest
To repeat my ask: apart from the current menu entry "Edit > Copy Link To Note", I request a "Edit > Copy Path to Note", which will give me enough information, and which will hopefully will be trivial for you to write.
Or, if the path to the archive is stored, perhaps somewhere in ~/Library, I can read from there...
Also, much less critical so feel free to ignore, is there yet a way to programmatically change the current folder?
Many thanks,
Abhijit
Howdy, Stranger!
Comments
I see a path in "Group\ Containers/FRMDA3XRGC.de.zettelkasten.TheArchive.prefs/Library/Preferences/FRMDA3XRGC.de.zettelkasten.TheArchive.prefs.plist"
Is that the right location
Abhijit, I use a two-step method when I want the full path of a note.
/Users/will/Dropbox/zettelkasten/Cosmic Pastoral 202305170541.md
I uploaded a gif showing how I do it. I'm not sure this is what you are asking. Do you want a note's full path or just the path to The Archive directory? I have a Python function for determining the full path to the active archive directory, but it doesn't return a specific path to a particular note.
Right-click on the note in the note list, selecting "Reveal in finder," or use the shortcut. Then in Finder, "Copy the Pathname," which is available by pressing down the Option Key while right-clicking on the target file.
The full pathname will be in the system clipboard.
If you use Keyboard Maestro or Alfred, you set up a keyboard macro for this if you find yourself doing it a lot.
The GIF turned out big and will take a minute to fully load, then it will run smoothly.
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
Thanks, Will.
I do want both, and I figured it out now. The crucial thing is that this should happen via a program and fast (okay to use both Keyboard Maestro and Alfred). Now I get the Archive path by reading from that file (which is a plist), and I get the path from there to the note using Edit > Copy Link To Note.
--Abhijit
@amahabal "Programmatic" inspection and modification is on my to-do list (via AppleScript) but not yet implemented.
There's an undocumented trick, though
Paste this into Script Editor:
This uses global system events to report the full path to the current note. That makes time tracking with Timing very accurate.
Author at Zettelkasten.de • https://christiantietze.de/
Thanks, @ctietze! That is good to know. Do you have a document with other such "undocumented" tricks? That would be worth bookmarking...
If I had, that would be documenting them
Some tips are on the help pages:
https://zettelkasten.de/the-archive/help/
Maybe I could add this one in case someone else looks for a way to ask The Archive for the currently open path (until AppleScript introspection works)
Author at Zettelkasten.de • https://christiantietze.de/
In consultation with my ZK, I found a method/function that programmatically works with Python to find the currently active folder path to The Archive, using the plist. Special shout-out to @pryley for the insight. This may give you ideas for adaptation to the language you use.
These are my modifications, and this is the function I currently use.
Output
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
Hi @Will,
I notice that in that code you are processing the plist with the NSData business. However, there is a standard plistlib module you could instead use. My code:
Hi @amahabal, the NSData business is from the Python 2.7 days. The function currently used is below. Mine returns the path as a path rather than a dictionary. I practiced adding some error handling in another version.
Thanks for a look into your code, your function is a bit crisper.
My code:
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com