Specifies the folder that is used by the files and folders functions and by commands that manipulate files.
# Metadata
Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:
# Syntax
set the defaultFolder to folderPath
# Examples
set the defaultFolder to "/Applications/GetIt" --MacOS, Linux-style file path
set the defaultFolder to "C:/Program Files/GetIt" -- Windows-style file path
# set the defaultFolder to the folder containing the stackfile set the itemDelimiter to slash get the effective filename of this stack set the defaultFolder to item 1 to -2 of it
# Description
Use the defaultFolder to perform file manipulations on files in the same folder without having to include the absolute file path.
The defaultFolder property specifies the folder LiveCode uses as the current folder when resolving relative file path (except for relative file path specified in the stackFiles property).
If you specify a file without giving its absolute file path, LiveCode looks for the file in the defaultFolder. If you specify a relative file path, the defaultFolder is prepend to it to create the absolute file path.
You cannot delete the current defaultFolder.
>*Important:* The folderPath is specified using Unix conventions, > even on Mac OS and Windows systems. The names of folders > are separated with a "/" character, > and absolute file path (starting with a disk or > partition name) must begin with a "/" character.
>*Note:* When setting the defaultFolder, any trailing slash will be > removed. For example:
set the defaultFolder to /Users/John/ put the defaultFolder -- returns /Users/John
# Tags
# See
- **keyword:** effective, it, item - **property:** itemDelimiter, stackFiles - **constant:** slash - **command:** create alias, revSetDatabaseDriverPath - **function:** files, folders, result - **glossary:** absolute file path, command, current folder, file, file path, folder, function, Mac OS, prepend, property, relative file path, string, Unix, value, Windows