Editor Scripting API

    Helper to create temporary directory.

    import * as fs from 'LensStudio:FileSystem';

    const resourceName = "resourceName.txt";

    // Create a temporary dir
    const tempDir = fs.TempDir.create();

    // Create a path that we want to write file to
    const resourcePath = tempDir.path;
    resoursePath.append(resourceName);

    // Write to the file
    fs.writeFile(resourceName, "Hello World");

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    path: Path

    Methods

    • Creates a temporary directory which will be deleted the moment all references to it disappears.

      Returns TempDir

    • Parameters

      • type: string

      Returns boolean

    MMNEPVFCICPMFPCPTTAAATR