15 December 2023

22 March 2021

7 December 2021

6 January 2015

The getinventorypath command can be used to retrieve full path names for inventory items by searching for a criteria.

CommandRequired ParametersRequired Corrade PermissionsExample
getinventorypathgroup, password, typeinventory
llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            // retrieve the inventory path of an inventory item
            // referenced by the inventory UUID 95553c51-8285-af6a-ed91-9ac30cf85c79
            "command", "getinventorypath",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            "type", "UUID",
            "UUID", "95553c51-8285-af6a-ed91-9ac30cf85c79",
            "callback", wasURLEscape(URL)
        ]
    )
);
ParameterSub-ParameterOptional ParameterPossible ValueDescription
typeUUIDan inventory UUIDRetrieve the full inventory path for an inventory item referenced by its inventory UUID.
patternpatha regular expressionSearch the inventory while matching inventory items by the regular expression specified by pattern, optionally just inside the folder given by path, and return the full paths to the found items.
optionsA CSV list of regular expression engine options.

Examples

The command can search both by inventory UUID and by regular expression. When searching by inventory UUID, for example:

llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            "command", "getinventorypath",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            "type", "UUID",
            "UUID", "95553c51-8285-af6a-ed91-9ac30cf85c79",
            "callback", wasURLEscape(URL)        
        ]
    )
);

the result will be a list with one single element if the inventory item exists and could be located or a false success status accompanied with an error message.

When searching the inventory using a regular expression, for example:

llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            "command", "getinventorypath",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            "type", "pattern",
            "options", wasListToCSV(["IgnoreCase"]),
            "pattern", wasURLEscape("Crystal[0-9]+"),
            "callback", wasURLEscape(URL)        ]
    )
);

then the paths of all items matching the regular expression Crystal[0-9]+ will be returned to the callback.

Notes