LocationBookmarks

Description

Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts

The LocationBookmarks API provides facilities for working with location bookmarks. A location bookmark associates a name with a directory services address.

Note: This is a protected API and it is only available to scripts with the appropriate permissions. Without them, the functions in this namespace won't do anything and will return empty values.

Methods

Name Return Value Summary
addBookmark None

Prompts the user to bookmark their current location. The user can specify the name of the bookmark in the dialog that is opened.

addBookmark None

Adds a new bookmark or replaces an existing one.

deleteBookmark None

Prompts the user to delete a bookmark. The user can select the bookmark to delete in the dialog that is opened.

getAddress string

Gets the directory services address associated with a bookmark.

getBookmarks object

Gets the details of all bookmarks.

getHomeLocationAddress string

Gets the directory services address associated with the "Home" bookmark.

removeBookmark None

Deletes a bookmark, if it exists.

setHomeLocationToAddress None

Sets the directory services address associated with the "Home" bookmark.

Method Details

(static) addBookmark( )

Prompts the user to bookmark their current location. The user can specify the name of the bookmark in the dialog that is opened.

(static) addBookmark( name, url )

Adds a new bookmark or replaces an existing one.

Parameters

Name Type Description
name string

The name of the bookmark.

url string

The bookmark's URL.

(static) deleteBookmark( )

Prompts the user to delete a bookmark. The user can select the bookmark to delete in the dialog that is opened.

(static) getAddress( bookmarkName ) → {string}
Returns: The directory services address for the bookmark. If the bookmark does not exist, "" is returned.

Gets the directory services address associated with a bookmark.

Parameters

Name Type Description
bookmarkName string

Name of the bookmark to get the directory services address for (case sensitive).

Example

Report the "Home" bookmark's directory services address.

print("Home bookmark's address: " + LocationBookmarks.getAddress("Home"));
(static) getBookmarks( ) → {object}
Returns: The current bookmarks in an object where the keys are the bookmark names and the values are the bookmark URLs.

Gets the details of all bookmarks.

Example

List the names and URLs of all the bookmarks.

var bookmarks = LocationBookmarks.getBookmarks();
print("Location bookmarks:");
for (const [name, url] of Object.entries(bookmarks)) {
    print(`- ${name} ${url}`);
}
(static) getHomeLocationAddress( ) → {string}
Returns: The directory services address for the "Home" bookmark.

Gets the directory services address associated with the "Home" bookmark.

(static) removeBookmark( name )

Deletes a bookmark, if it exists.

Parameters

Name Type Description
name string

The name of the bookmark.

(static) setHomeLocationToAddress( address )

Sets the directory services address associated with the "Home" bookmark.

Parameters

Name Type Description
address string

The directory services address to set the "Home" bookmark to.