Skip to content

Get parent note title for backlink on new file creation from empty link #799

Answered by welpdx
cedardocster asked this question in Help
Discussion options

You must be logged in to vote

One easy implementation what you want is this:

<%* 
let files = this.app.workspace.getLastOpenFiles();
let lastFile = this.app.vault.getAbstractFileByPath(files[0]); // t file
tR+= `you last file is: [[` + lastFile.basename +`]]`
%>

Add it to Folder Templates to trigger it when you create a new note or you can just use it as is.

Demo

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@cedardocster
Comment options

Answer selected by cedardocster
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants