Replies
|
Found the solution: |
0 replies
Answer selected by welpdx
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When ever I make a new note, I have a template that adds a heading and stuff (it mimics IMF note format).
I am having issues figuring out a code snippet that creates an internal link which refers to the last visited file.
For example:
Say I am working on a file called [[Obsidian MOC]] and in this file I make an internal link [[Obsidian Plugins]] and I click it to create the file. In this new file [[Obsidian Plugins]], I want to use text snippet to automatically create a backlink to [[Obsidian MOC]].
I was wondering if there is a system variable or something that accesses Obsidian's navigation history.
Theoretically, if the navigation stack is like this: ["Obsidian MOC.md", "Obsidian Plugins.md"], all I have to do is point to the previous item in this stack.
Thanks for your help.
Found the solution:
Apparently, Obsidian keeps a workspace file which also records Navigation History in a sort of list or dictionary (idk im not a programmer). Apparently there's an Obsidian API with a handy getLastOpenFiles() function, which can return the list of strings.