WARNING: The [sjs-3] engine was deprecated, use [sjs-4] instead. See sjs-4: title.

File.prototype.title()

Get/set a file’s title.

Syntax

// Get file.title() string // Set file.title(title string) File file.title(title string, updateName bool) File

Parameters

title string

The file’s new title.

updateName bool

The file’s name may be changed according to the new title. For example, “Hello world!” would become “hello-world”.

Description

Get/set a file’s title. Note that when setting a file’s title, its name is not modified. If you want to modify a file’s title and have its name updated as well, you’ll need to move the file, see example below.

Examples

Get.

Set title only.

Set title, update name.

Subscribe to our newsletter!