getResource |
Type | function |
Dictionary | LCS |
Library | LiveCode Script |
Syntax | getResource(<filePath>, <resourceType>,{<resourceName> | <resourceID>})
|
Summary | Returns the data in a Mac OS resource.
|
Introduced | 1.1 |
OS | mac |
Platforms | desktop, server |
Parameters | Name | Type | Description |
---|
filePath | | The location and name of the file that holds the resource you want. If
you specify a name but not a location, LiveCode assumes the file is in
the defaultFolder.
|
resourceType | | The 4-character type of the resource you want.
|
resourceName | | |
resourceID | | |
|
Example | getResource("/Hard Drive/Stuff","DLOG",128)
getResource(it,"BNDL","Application")
|
Values | Name | Type | Description |
---|
return | | The getResource function returns the text or binary data in
the specified resource. If the specified resource does not exist, the
getResource function returns empty.
|
The result | | If the filePath does not exist, the result is set to
"can't find file". If the filePath exists, but the file has no
resource fork, the result is set to "can't open resource fork". If
the filePath contains a resource fork but does not contain the
specified resource, the result is set to
"can't find specified resource".
|
|
Related | Keyword: file
Function: result, setResource
Glossary: resource fork, resource, Mac OS, return
Control Structure: function
|
Security | disk |
Description | Use the getResource function to get the contents of a resource.
|
Tags | file system |