%% date:: [[2023-01-24]] %% # [[Obsidian API]] Learning how to use [[Obsidian]]'s [[API]] for creating plugins or scripts that are executed via plugins like [[Obsidian Templater]], [[Obsidian Dataview|Dataview]], and [[Obsidian QuickAdd]]. ### Getting the current file's path To get the path of the currently open file relative to the vault directory: ```javascript params.app.workspace.getActiveFile().parent.path ``` This returns, for example, `ttrpgs/Sample World`.