PluginFiles
File dialogs, which need the "files.dialog" permission, and the plugin’s data folder.
Example
Section titled “Example”context.registerCommand({ id: "export", title: "Export CSV", async run() { const file = await context.files.save({ name: "faces.csv", filters: [{ name: "CSV", extensions: ["csv"] }] }); if (file) { file.writeText("kind,count\nface,12\n"); } },});Properties
Section titled “Properties”
readonlydata:PluginDataFiles
Methods
Section titled “Methods”open()
Section titled “open()”open(
options?):Promise<PluginFile|null>
Asks the user for a file to open, and resolves with it, or null when they cancel. The
dialog shows after the plugin’s code for this frame; a command that awaits it finishes,
and continues once the user answers. When another model opens first, the promise rejects
with a ReferenceError, and the code that runs for it can’t reach the model open now.
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Promise<PluginFile | null>
save()
Section titled “save()”save(
options?):Promise<PluginFile|null>
Asks the user where to save, like open; the plugin may then write that file.
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Promise<PluginFile | null>