PALATINELABSDocsENES

Pages

↑↓ to moveEnter to openEsc to close

Folder package guide

Use Folder to manage local folders, list files, write ZIP archives and evaluate folder conditions.

Version 2.14.0. Installed versions can differ. Examples are illustrative and not tested.

Jump to actions

Packages

Prerequisites

This package is for Windows. Use an account that can read sources and write or delete the targets. A relative path starts in the Run folder. A full path is used as given. Try examples on test data in samples. Keep copy destinations and ZIP outputs outside the source folders.

Careful

ZIP

Needs

Shared fields

A field is optional unless its table says required. An action that uses a shared table says so under its Inputs.

Size and date filters

Copy checks each file. Delete and Rename check the size of everything in the folder and the folder's own dates. The size fields are used only when isSize is on, and the date fields only when isDate is on. A file or folder must pass every filter that is on. Dates use the Device's local time.

Field IDName in editorType; defaultUse
isSizeSizeBooleandefault falsetrue turns on the size filter.
sizeValuesizeValueSizeComparisondefault AtleastAtleast⁠: the size or more. Atmost⁠: the size or less. Exact⁠: less than one byte apart.
sizeSize (KB)Numberdefault 0The size in KB (1 KB = 1024 bytes). 2 is 2048 bytes.
isDateDateBooleandefault falsetrue turns on the date filter.
dateValuedateValueDateFielddefault CreatedCreated⁠: the creation time. Modified⁠: the last time the file was written.
dateRangeValuedateRangeValueDateRangedefault DaysDays⁠: in the last N days. Between⁠: between two dates. On⁠: on one date. Before⁠: before a date.
daysDaysNumberdefault 0For Days⁠: whole days back from now. The limit is included.
startDateStart date (MM/dd/yy)Stringdefault ""For Between⁠: month/day/year, for example 10/01/26 or 10/01/2026⁠. The time is ignored.
endDateEnd date (MM/dd/yy)Stringdefault ""For Between⁠: the end date, for example 10/15/26⁠, in the same form as startDate⁠.
isEndDateIncludedInclude start and end datesBooleandefault falseFor Between⁠: true includes both end dates; false leaves out both.
onDateDate (MM/dd/yy)Stringdefault ""For On⁠: the date, for example 10/15/26⁠. Any time that day matches.
beforeDateDate (MM/dd/yy)Stringdefault ""For Before⁠: the date, for example 10/15/26⁠, as month/day/year.
isBeforeDateIncludedIncluding dateBooleandefault falseFor Before⁠: true includes that date; false only earlier dates.

Actions

Get Available Directory (folderAvailableName)

Find a folder name that is not used yet, such as reports_1. Nothing is created or reserved. A file at that path is not checked.

Inputs

Field IDName in editorType; defaultUse
parentPathParent directory pathStringdefault ""requiredParent folder in which to find a free directory name, e.g. samples⁠.
directoryNameDirectory nameStringdefault ""requiredProposed single folder name, e.g. reports⁠. Use no folder path. On conflicts, the action tries reports_1⁠, reports_2 and so on.

Outputs

OutputEditor fieldType and use
resultAssign available directory path toFile value (Any). Bind to a File variable; its value is path text. It does not contain file bytes.

Example

Create samples/reports and ensure samples/reports_1 is absent. Set parentPath=samples, directoryName=reports; bind result to nextFolder.

Expected result

The File value ends in samples/reports_1 as an absolute path. No folder is created.

Back to actions

Copy (folderCopyFolder)

Copy selected files from a folder and its subfolders into a destination folder. Empty subfolders are skipped.

Inputs

Field IDName in editorType; defaultUse
sourceFolderPathSource folderStringdefault ""requiredSource folder path, e.g. samples/reports⁠. Use one folder without wildcards.
destinationFolderPathDestination folderStringdefault ""requiredParent destination folder. The source folder name is added automatically. samples/backup plus source samples/reports produces samples/backup/reports⁠.
isOverwriteOverwrite existing files/foldersBooleandefault falseAllow replacement of an existing target. Leave false to receive an error on a conflict.

Also uses the size and date filters.

Outputs

No outputs.

Example

Prepare samples/reports/a.txt with 1 byte and samples/reports/nested/b.txt with 4096 bytes. Set sourceFolderPath=samples/reports, destinationFolderPath=samples/backup, isOverwrite=false, isSize=true, sizeValue=Atleast, size=2, isDate=false.

Expected result

Only samples/backup/reports/nested/b.txt is copied. A missing source fails. A conflicting target fails unless overwrite is enabled. Keep the destination outside the source folder.

Back to actions

Create (folderCreateFolder)

Create a folder and its missing parents. Overwrite deletes the existing folder and its contents first.

Inputs

Field IDName in editorType; defaultUse
folderPathFolderStringdefault ""requiredFolder path, e.g. samples/reports⁠. Relative paths use the Run folder.
isOverwriteOverwrite an existing folderBooleandefault falsetrue recursively deletes the existing folder and all its contents, then creates an empty folder. This is destructive. false reports an existing folder as an error.

Outputs

No outputs.

Example

Set folderPath=samples/disposable/new, isOverwrite=false, with no existing folder there.

Expected result

The new folder exists and is empty. A second execution fails. With isOverwrite=true, all previous files and subfolders are permanently deleted first.

Back to actions

Create symbolic link (folderCreateFolderShortcut)

Create a symbolic link to a folder. The target is not copied.

Inputs

Field IDName in editorType; defaultUse
sourceFolderPathTarget locationStringdefault ""requiredSource folder path, e.g. samples/reports⁠. Use one folder without wildcards.
targetFolderSymbolic link locationStringdefault ""requiredFolder in which to write the link, e.g. samples/links⁠. The action creates this folder if needed. This is not the full link filename.

Outputs

No outputs.

Example

Prepare samples/reports/a.txt. Set sourceFolderPath=samples/reports, targetFolder=samples/links, with no existing samples/links/reports.

Expected result

samples/links/reports links to the original folder. Reading samples/links/reports/a.txt reads the original file. An occupied link path or lack of privilege fails.

Back to actions

Create shortcut (folderCreateShortcut)

Create a Windows shortcut (.lnk) to a folder.

Inputs

Field IDName in editorType; defaultUse
sourceFolderPathTarget locationStringdefault ""requiredSource folder path, e.g. samples/reports⁠. Use one folder without wildcards.
targetFolderShortcut locationStringdefault ""requiredFolder in which to write the link, e.g. samples/links⁠. The action creates this folder if needed. This is not the full link filename.

Outputs

No outputs.

Example

Prepare samples/reports. Set sourceFolderPath=samples/reports, targetFolder=samples/links.

Expected result

The action writes samples/links/reports.lnk, using the target folder as its working folder. It does not open or copy the folder. Missing Windows Script Host fails.

Back to actions

Delete (folderDeleteFolder)

Delete a folder and everything in it, for good.

Inputs

Field IDName in editorType; defaultUse
folderPathFolderStringdefault ""requiredFolder path, e.g. samples/reports⁠. Relative paths use the Run folder.

Also uses the size and date filters.

Outputs

No outputs.

Example

Prepare disposable samples/disposable/remove/a.txt. Set folderPath=samples/disposable/remove, isSize=false, isDate=false.

Expected result

The folder and all its contents are deleted without the Recycle Bin. A missing or filter-rejected folder is left alone. Permission or lock errors can interrupt deletion.

Back to actions

Get files with extensions (folderFilesWithExtensions)

List files from a folder and, if selected, its subfolders. The order is not fixed.

Inputs

Field IDName in editorType; defaultUse
directoryPathDirectory pathStringdefault ""requiredFolder path, e.g. samples⁠. Relative paths use the Run folder.
searchRecursivelySearch recursivelyBooleandefault falsetrue searches all subfolders. false searches only the named folder.
filterTypeFiles to includeFilterTypedefault ALLALL returns every file and ignores extensions⁠. SPECIFIC returns only files whose extension is in the list. An empty list with SPECIFIC returns no files.
extensionsExtensionsListdefault []List of extension strings, e.g. a List variable with txt and csv⁠. Leading dots and surrounding spaces are removed; matching ignores letter case.

Outputs

OutputEditor fieldType and use
resultAssign file paths toList of File values with absolute paths. Bind to a List variable and process its items with a loop. Order is not guaranteed.

Example

Prepare samples/list/a.txt, b.csv and sub/c.txt. Prepare List allowed with String txt. Set directoryPath=samples/list, searchRecursively=true, filterType=SPECIFIC, extensions=$allowed$; bind result to found.

Expected result

found contains the absolute File paths for a.txt and sub/c.txt, in unspecified order. No matches returns an empty List. A missing or inaccessible folder fails.

Back to actions

Open (folderOpenFolder)

Open an existing folder in Windows.

Inputs

Field IDName in editorType; defaultUse
folderPathFolderStringdefault ""requiredFolder path, e.g. samples/reports⁠. Relative paths use the Run folder.

Outputs

No outputs.

Example

Prepare samples/reports. Set folderPath=samples/reports.

Expected result

Windows is asked to display the folder, normally in File Explorer. The action does not wait for that window to close. A missing folder or Windows error fails.

Back to actions

Get parent folder (folderParent)

Get the folder that holds a path. The path need not exist.

Inputs

Field IDName in editorType; defaultUse
filePathFileStringdefault ""requiredPath to the file, e.g. samples/invoice.txt⁠. Relative paths use the Run folder.

Outputs

OutputEditor fieldType and use
resultAssign parent folder toFile value (Any). Bind to a File variable; its value is path text. It does not contain file bytes.

Example

Set filePath=samples/reports/invoice.csv; bind result to parent.

Expected result

parent is a File value whose absolute path ends in samples/reports. For a filesystem root with no containing folder, the result is empty.

Back to actions

Rename (folderRenameFolder)

Rename a folder in the same parent folder.

Inputs

Field IDName in editorType; defaultUse
folderPathFolderStringdefault ""requiredFolder path, e.g. samples/reports⁠. Relative paths use the Run folder.
newFolderNameNew folder nameStringdefault ""requiredNew leaf name, e.g. reviewed⁠. The folder stays in the same parent. Paths, separators, . and .. are rejected.

Also uses the size and date filters.

Outputs

No outputs.

Example

Prepare disposable samples/old/a.txt with kept. Set folderPath=samples/old, newFolderName=reviewed, isSize=false, isDate=false, with no samples/reviewed target.

Expected result

samples/reviewed/a.txt contains kept; samples/old is gone. Missing or filter-rejected source folders are skipped. An occupied destination causes an error.

Back to actions

Unzip (folderUnzipFiles)

Extract an unencrypted ZIP, protecting existing files unless overwrite is enabled.

Inputs

Field IDName in editorType; defaultUse
sourcePathZip file name with full pathStringdefault ""requiredExisting ZIP filename, e.g. samples/archive.zip⁠. Password-protected ZIP archives are not supported.
targetPathExtract to pathStringdefault ""requiredFolder to receive archive entries, e.g. samples/extracted⁠. It is created if needed. Entry subfolders are preserved.
isOverwriteReplace existing fileBooleandefault falseAllow replacement of an existing target. Leave false to receive an error on a conflict.
passwordPassword to access zip fileCredentialdefault empty CredentialLeave the Credential password empty. A nonempty password is rejected: this package cannot create or extract password-protected ZIP archives. The username is not used.

Outputs

No outputs.

Example

Prepare samples/archive.zip containing docs/a.txt with one. Set sourcePath=samples/archive.zip, targetPath=samples/extracted, isOverwrite=false; leave password empty.

Expected result

samples/extracted/docs/a.txt contains one. The ZIP remains. An existing conflicting file, invalid archive or nonempty password fails; earlier entries can already have been extracted.

Back to actions

Zip (folderZipFiles)

Put files and folders into a ZIP file. Empty folders are skipped. If two files have the same entry name, the first wins. Entries are added in alphabetical name order.

Inputs

Field IDName in editorType; defaultUse
sourcePathSpecify file(s)/folder(s) to compressStringdefault ""requiredOne or more file paths, folder paths or last-segment wildcards, separated by semicolons, for example samples/docs;samples/extra.txt⁠. A folder contributes all matching files in the folder and its subfolders under its own name. Missing sources contribute nothing.
filterTypeSpecify file type(s) to compressFilterModedefault StringValueStringValue uses filterExtensions⁠; RegexValue uses regexFilter⁠. An empty active filter accepts every filename.
filterExtensionsfilterExtensionsStringdefault ""For StringValue⁠, enter filename wildcard patterns separated by semicolons, e.g. *.txt;*.csv⁠. Matching ignores letter case. A bare txt is a filename pattern, not an extension shortcut.
regexFilterregexFilterStringdefault ""For RegexValue⁠, enter a .NET regular expression applied to the filename only, e.g. ^invoice_[0-9]+[.]pdf$⁠. Matching is case-sensitive and has a five-second timeout per test.
targetPathSpecify destination filename and locationStringdefault ""requiredFull ZIP output filename, e.g. samples/archive.zip⁠. Keep it outside all selected source folders and different from all source files. Parent folders are created.
isUpdateNewerUpdate only if newerBooleandefault falsetrue updates an existing ZIP: it keeps an entry when its ZIP timestamp is at least as new as the source, and replaces older entries. Unrelated entries remain. false deletes any existing target ZIP and creates a new one.
isDeleteOriginalFilesDelete original filesBooleandefault falsetrue permanently deletes every selected source file after the archive is closed, including files skipped as not newer during an update. It also removes immediate containing folders that become empty, except the job folder. Use disposable sources.
compressionLevelCompressionCompressiondefault NormalNormal uses optimal compression. Fast and Superfast both use the fastest compression available from the runtime.
passwordPassword protectionCredentialdefault empty CredentialLeave the Credential password empty. A nonempty password is rejected: this package cannot create or extract password-protected ZIP archives. The username is not used.

Outputs

No outputs.

Example

Prepare disposable samples/docs/a.txt, samples/docs/deep/b.txt and samples/docs/skip.md. Set sourcePath=samples/docs, filterType=StringValue, filterExtensions=*.txt, targetPath=samples/archive.zip, compressionLevel=Fast, isUpdateNewer=false, isDeleteOriginalFiles=false; leave password empty.

Expected result

The ZIP contains docs/a.txt and docs/deep/b.txt; source files remain. Missing sources can produce an empty ZIP. With update disabled, an existing target archive is replaced. Password protection is rejected.

Back to actions

Conditions

Each condition returns true or false for an If or Loop step. It has no outputs.

Folder does not exist (folderDoesNotExists)

Test for no directory, optionally waiting for removal. A file at the path also satisfies the test.

Inputs

Field IDName in editorType; defaultUse
folderPathFolder pathStringdefault ""requiredFolder path, e.g. samples/reports⁠. Relative paths use the Run folder.
waitTimeoutWait for this condition (seconds)Numberdefault 0Maximum whole seconds: 0 or negative tests once; positive polls about every 250 ms until true or timeout.

Outputs

No outputs.

Example

Ensure samples/absent-folder is absent. Set folderPath=samples/absent-folder, waitTimeout=0.

Expected result

true. An existing folder is false until it disappears or the wait ends.

Back to conditions

Folder exists (folderExists)

Test directory existence, optionally waiting for appearance. A file does not count.

Inputs

Field IDName in editorType; defaultUse
folderPathFolder pathStringdefault ""requiredFolder path, e.g. samples/reports⁠. Relative paths use the Run folder.
waitTimeoutWait for this condition (seconds)Numberdefault 0Maximum whole seconds: 0 or negative tests once; positive polls about every 250 ms until true or timeout.

Outputs

No outputs.

Example

Prepare samples/present-folder. Set folderPath=samples/present-folder, waitTimeout=0.

Expected result

true. A missing folder returns false after the optional wait.

Back to conditions

Folder has file with extension (folderHasFileWithExtension)

Check if a folder has (or does not have) a file with an extension. It can include subfolders and wait.

Inputs

Field IDName in editorType; defaultUse
directoryPathFolder pathStringdefault ""requiredFolder path, e.g. samples⁠. Relative paths use the Run folder.
conditionTypeConditionContainsConditiondefault CONTAINSCONTAINS is true when at least one matching file exists. NOTCONTAINS is true when none exists, including when the folder is missing.
extensionFile extensionStringdefault ""requiredSingle extension, e.g. txt or .txt⁠. The search pattern is *. plus the extension after spaces and leading dots are removed. Filename matching follows the operating system.
searchRecursivelySearch recursivelyBooleandefault falsetrue searches all subfolders. false searches only the named folder.
waitTimeSecondsWait for this condition (seconds)Numberdefault 0Maximum wait in seconds; fractions are accepted. 0 or a negative value tests once. A positive value polls about every 250 ms.

Outputs

No outputs.

Example

Prepare samples/check/sub/a.txt, with no .txt file directly in samples/check. Set directoryPath=samples/check, conditionType=CONTAINS, extension=txt, searchRecursively=true, waitTimeSeconds=0.

Expected result

true; without subfolders it is false. NOTCONTAINS reverses the test, and is true for a missing folder. Access errors while listing files can fail the condition.

Back to conditions