> ## 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

> 获取当前打开文件路径。

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

## 示例

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

/**
 * 获取当前文件路径的示例。
 */
export async function exampleGetCurrentFilePath() {
  const res = await PluginCommAPI.getCurrentFilePath();
  if (!res.success) {
    throw new Error(res.error?.message ?? 'getCurrentFilePath 调用失败');
  }
  return res.result;
}
```
