filedisplayname(
filedisplayname(
PATH
)

The filedisplayname( function returns the display name for the specified file or folder.

Parameters

This function has one parameter:

path – is a path to the item you want information about, including the file (or folder) name (see Files and Folders for more information about file paths).

Description

This function returns the display name for the specified file or folder. This is the name of the file or folder as it appears in the Finder. The display name is usually the same as the name, but not always. For example some files or folders may have “localized” names, i.e. names that have been translated into French, German, Italian, Japanese, etc. Depending on system settings, the display name may also have the extension (.pdf, .doc, .jpg, etc.) removed.

A stock copy of Mac OS X contains a file named About Stacks.lpdf in the Documents folder. In the Finder, this file is displayed without it’s extension, simply as About Stacks.

    filedisplayname("~/Documents/About Stacks.lpdf") ☞ About Stacks

Note: If the specified file or folder doesn’t exist, this function will return an empty string (`""`).

History

Version | Status | Notes
10.0 | New | New in this version.