Livecode Wiki
Advertisement

Removes a resource from the resource fork of a Mac OS file.Syntax:

deleteResource(<file>, <resourceType>,{<resourceID> | <resourceName>})

Examples:

get deleteResource("New Build","ICN#",129)
put deleteResource(line x of theFiles,"XFCN","Colorize") into temp

Use the deleteResource function to delete a resource from a file.

The deleteResource function deletes individual resources within the file, but does not delete the resource fork.

Parameters:

  • file: The name and location of the file containing the resource. If youspecify a name but not a location, LiveCode assumes the file is in thedefaultFolder.
  • resourceType: The 4-character type of the resource you want to delete.
  • resourceID (integer): An integer that specifies the resource ID of the resource you want todelete.
  • resourceName: The name of the resource you want to delete.
  • Returns: The deleteResource function always returns empty.
  • The result: If the file does not exist, the result is set to "can't find file".If the file exists but has no resource fork, the result is set to"can't open resource fork". If the file exists but does not containthe specified resource, the result is set to"can't find the resource specified". If the file is already open, theresult is set to "Can't open resource forka/".

See also: result (function),setResource (function),externals (property),

Advertisement