# Metadata
Platforms: desktop OS: mac Introduced: 1.0 Security: disk
# Syntax
copyResource(file, destinationFile, resType,{resID | resName}[, newID])
# Params
- file : The name and location of the file containing the resource. If you specify a name but not a location, LiveCode assumes the file is in the defaultFolder. - destinationFile : The name and location of the file you want to copy the resource to. - resType : The 4-character type of the resource you want to move. - resID : An integer that specifies the resource ID of the resource you want to copy. - resName : The name of the resource you want to copy. - newID : An integer that specifies the resource ID for the newly-copied resource.
# Examples
get copyResource("Template","New Build","vers",1,1)
put copyResource(theFile,anotherFile,"XCMD","SetPort") into trashVar
get copyResource(field "Source",currentFile,nextResource,200)
# Description
Use the copyResource function to copy resources (such as icons, externals, and version resources) from one file to another.
If you don't specify a newID, the new resource has the same ID as the original resource. Specifying a newID does not change the resource ID of the original resource in the file; it only affects the copy in the destinationFile.
# Tags
# See
- **keyword:** file - **command:** copy - **function:** result, setResource - **control structure:** function - **glossary:** resource fork, resource, Mac OS, return