Livecode Wiki
Advertisement

Returns the data in a Mac OS resource.Syntax:

getResource(<filePath>, <resourceType>,{<resourceName> | <resourceID>})

Examples:

getResource("/Hard Drive/Stuff","DLOG",128)
getResource(it,"BNDL","Application")

Use the getResource function to get the contents of a resource.

Parameters:

  • filePath: The location and name of the file that holds the resource you want. Ifyou specify a name but not a location, LiveCode assumes the file is inthe defaultFolder.
  • resourceType: The 4-character type of the resource you want.
  • resourceName (string):
  • resourceID (integer):
  • Returns:The getResource function returns the text or binary data inthe specified resource. If the specified resource does not exist, thegetResource 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 noresource fork, the result is set to "can't open resource fork". Ifthe filePath contains a resource fork but does not contain thespecified resource, the result is set to"can't find specified resourcea/".

See also: setResource (function),

Advertisement