Skip to main content

File

27 commands. Toolkit id ooa.file.

CommandWhat it does
Base64 to fileWrite Base64 text (for example a PDF or image returned by a web service) to a file.
CopyCopy a file, every file the name rules choose, or every file of a folder that matches a pattern and optional size and date limits, replacing or keeping existing targets.
Create fileCreate an empty file (or one holding some text), choosing what happens when a file of that name is already there.
Create shortcutCreate a shortcut that opens a file: a .lnk file on Windows, a .desktop file or symbolic link elsewhere.
Create symbolic linkCreate a symbolic link that points to a file; on Windows this needs Developer Mode or administrator rights.
Create temporary fileCreate an empty file with a unique name in the temporary folder (or another folder), for working data an agent needs only for a while.
DeleteDelete a file if it exists, every file the name rules choose, or every file in a folder that matches a pattern and optional size and age limits.
Each file in folderYield each file in a folder (or each file the name rules choose): its path, or with details its name, extension, folder, size and date.
File date isCompare when a file was last changed or created with a date or a range, or check its age in days, hours, minutes or seconds.
File existsTrue when the file exists.
File has extensionTrue when the file name ends with one of the extensions, e.g. pdf, xlsx (case is ignored).
File size isCompare the size of a file with a number of bytes, KB or MB, e.g. larger than 0 bytes.
File to Base64Read a file (a PDF, an image, any file) as Base64 text, for web services that take attachments as text.
Get file from One CommandCenterCopy a file kept in One CommandCenter (its Agents page, Files) to the runner, by its path there; the path may come from a variable.
Get file infoReturn a file's name, extension, folder, size and last modified time.
Get file nameReturn the last part of a path, with and without its extension; the file does not need to exist.
Get parent folderReturn the folder that contains a file or folder, as a full path.
List filesList the files in a folder that match a pattern, or the files the name rules choose.
Move or renameMove or rename a file, or move every file the name rules choose or every file of a folder that matches a pattern and optional size and date limits, replacing or keeping existing targets.
Print filesPrint several files, in order, on a named printer or with each file's default application.
Read textRead a text file.
Read variables from fileRead name=value lines (a settings or .properties-style file) into a Dictionary; blank lines and lines starting with # or ; are skipped.
Rename fileGive a file a new name in the same folder.
UnzipExtract a .zip archive into a folder, also a password-protected one (AES or the older ZipCrypto); entries that would escape the folder are rejected.
Wait for fileWait until a file appears and has stopped growing (for example a download or an export), then return its path.
Write textWrite text to a file, overwriting or appending.
ZipCompress files or a folder into a .zip archive, or add them to an existing one, optionally protected with a password (AES-256, opened by 7-Zip, WinZip and most tools).