Tutorial

Getting Started with Macros

Macro Editor

User Interface

Menus and Toolbar

Editing Macros

Macro Debugging

How To

Using variables

Finding and modifying objects

Creating new page content

Asking for user input

Storing persistent data

Using binary data

Sorting objects

Macro menus

Bulleted and numbered lists

Accessing the file system

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Last updated on: February 02, 2025
Also available as a single HTML file

Onetastic Macro Documentation > How To > Accessing the file system

Accessing the File System

Onetastic Macros can access the file system on the local computer using File System Functions.

File and Folder objects

File and Folder objects represent files and folders on local disk. They may point to files and folders that exist or ones that don't exist yet. They provide basic information about the files and folders like their names and full paths. You can obtain these objects from file pickers or certain File System functions. They can be passed to most other File System functions to get more information about the files and folders or read from and write to files.

Checking existance of files and folders

You can check if a file or folder exists using the following functions:

Asking user to pick files and folders

Following functions can be used to ask user to pick files to read or write, or pick folders:

Creating and deleting files and folders

To create folders, use the FileSystem_CreateFolder function. To create files, use the FileSystem_WriteToFile function. Files and folders can be deleted using the following two functions:

Reading and writing files

To read contents of existing files and write data to files on disk, use the following functions:

Enumerating contents of a folder and known folders

You can enumerate the contents of a folder using FileSystem_GetFolderEntries. It can either provide you all files and subfolders of a folder, or you can filter to specific extensions.

You can also get access to specific known folders like user's Desktop or Documents using the FileSystem_GetKnownFolder function.

Obtaining the size of a file

FileSystem_GetFileSize function can be used to obtain the size of an existing file on disk.

Reference

Statements

Hierarchy Objects

Page Objects

Other Objects

Functions

Array Functions

Color Functions

Data Store Functions

Date/Time Functions

Dialog Box Functions

File System Functions

Macro Execution Functions

Macro Menu Functions

Object Functions

Special Functions

String Functions

Window Functions