Not returning to parent folder #1147
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
So instead of getting the parent folder, you want to go two levels up, correct? Instead of <% tp.file.folder(true).split('/').pop() %> you can do <% tp.file.folder(true).split('/')[2] %> The |
Beta Was this translation helpful? Give feedback.
-
Yes, this is correct. Thank you for the help. Does this <% this.app.workspace.getActiveFile().parent.name %> |
Beta Was this translation helpful? Give feedback.
So instead of getting the parent folder, you want to go two levels up, correct?
Instead of
you can do
The
[2]
will get the third folder from the root of the vault, since JavaScript arrays have zero based indices. You can do whatever level folder you want, just minus one to get the level you want.