15 December 2023
22 March 2021
type parameter and the ability to retrieve the full path of an inventory item both by inventory UUID and by searching using regular expressions.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.
| Command | Required Parameters | Required Corrade Permissions | Example |
|---|---|---|---|
getinventorypath | group, password, type | inventory | |
| Parameter | Sub-Parameter | Optional Parameter | Possible Value | Description |
|---|---|---|---|---|
type | UUID | an inventory UUID | Retrieve the full inventory path for an inventory item referenced by its inventory UUID. | |
pattern | path | a regular expression | Search 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. |
|
options | A CSV list of regular expression engine options. |
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.
UUID, the UUID parameter takes as value an inventory UUID.path parameter in case the folder in which the searched item resides is known before executing the command.