> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supernote.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getCurrentFilePath

> Get the file path of the currently opened file.

```ts theme={null}
static getCurrentFilePath(): Promise<APIResponse<string>>;
```

## Example

```ts wrap theme={null}
import { PluginCommAPI } from 'sn-plugin-lib';

/**
 * Example: get current file path.
 */
export async function exampleGetCurrentFilePath() {
 const res = await PluginCommAPI.getCurrentFilePath();
 if (!res.success) {
 throw new Error(res.error?.message ?? 'getCurrentFilePath call failed');
 }
 return res.result;
}
```
