news |
info |
people |
software |
stuff |
Rezzer XFCN. Version 1.0, by Sam Deane. Copyright ©1994 ULTRALAB. Compiled 16:57:54, 28/04/94.
You can obtain a list of all resources, and all types of resource present, either in the current stack or in all stacks in the inheritance path.
You can rename, renumber, copy and delete resources, and test whether a particular resource is present.
You can also use this XCMD to manipulate TEXT/styl resources, by getting and setting their contents.
Commands
saveThe syntax is:
get Rezzer("save",<handle>,<name>)
The <handle> parameter should be a handle to some resource, as returned by the handle command.
The <name> parameter should be the name or id to use for the new resource.
allThe syntax is:
get Rezzer("all",<type>)
The <type> parameter should be a four letter resource type, for example PICT for picture resources.
The result is returned as a list, with one line for each resource found. Each line contains two items: the name of the resource and its id.
Example script for allon mouseUp ask "Type?" if it is not empty then ShowResult "Resources of type " & it,Rezzer(all,it) end if end mouseUp
listThe syntax is:
get Rezzer("list",<type>)
The <type> parameter should be a four letter resource type, for example PICT for picture resources.
The result is returned as a list, with one line for each resource found. Each line consists of two items: the name of the resource, and its id.
Example script for liston mouseUp ask "Type?" if it is not empty then ShowResult "Resources of type " & it,Rezzer(list,it) end if end mouseUp
typesThe syntax is:
get Rezzer("types")
The result is returned as a comma-delimited list of resource types.
Example script for typeson mouseUp ShowResult "Resources types in stack",Rezzer(types) end mouseUp
renameThe syntax is:
get Rezzer("rename",<name>,<type>,<newname>)
The <name> parameter should be the name or id of an existing resource.
The <type> parameter should be a four letter resource type.
The <newname> parameter should contain the new name of the resource. Note that this command does not check for duplicate names, so that it is possible to give two or more resources the same name.
Example script for renameon mouseDown ask "name, kind, new name?" if the number of items in it is 3 then put item 1 of it into oldname put item 2 of it into type put item 3 of it into newname get Rezzer(rename,oldname,type,newname) get Rezzer(list,type) answer it end if end mouseDown
renumberThe syntax is:
get Rezzer("renumber",<name>,<type>,<newnumber>)
The <name> parameter should be the name or id of an existing resource.
The <type> parameter should be a four letter resource type.
The <newnumber> parameter should contain the new id of the resource.
Example script for renumberon mouseDown ask "name, kind, new id?" if the number of items in it is 3 then put item 1 of it into oldname put item 2 of it into type put item 3 of it into newid get Rezzer(renumber,oldname,type,newid) get Rezzer(list,type) answer it end if end mouseDown
removeThe syntax is:
get Rezzer("remove",<name>,<type>)
The <name> parameter should be the name or id of the resource to remove.
The <type> parameter should be a four letter resource type.
alltypesThe syntax is:
get Rezzer("alltypes")
The result is returned as a comma-delimited list of resource types.
Example script for alltypeson mouseUp ShowResult "All resources types in path",Rezzer(allTypes) end mouseUp
getFieldThe syntax is:
get Rezzer("getField",<resource>,<field>,<background>)
The <resource> parameter should contain the name or id of the TEXT resource to use.
The <field> parameter should contain the name of the field to put the text into.
The <background> parameter is a boolean, indicating whether or not the field is a background field.
Example script for getFieldon mouseDown get Rezzer(getField,"another test","text",true) end mouseDown
storeFieldThe syntax is:
get Rezzer("storeField",<resource>,<field>,<background>)
The <resource> parameter should contain the name or id of the TEXT resource to use.
The <field> parameter should contain the name of the field to that the text should be taken from.
The <background> parameter is a boolean, indicating whether or not the field is a background field.
Example script for storeFieldon mouseDown get Rezzer(storeField,"another test","text",true) end mouseDown
getTextThe syntax is:
get Rezzer("getText",<resource>)
The <resource> parameter should contain the name or id of the TEXT resource to store the text in.
Example script for getTexton mouseDown put Rezzer(getText,"another test") end mouseDown
storeTextThe syntax is:
get Rezzer("storeText",<resource>,<text>)
The <resource> parameter should contain the name or id of the TEXT resource to use.
The <text> parameter should contain the text to store.
Example script for storeTexton mouseDown get Rezzer(storeText,"another test",bg fld "text") end mouseDown
handleThe syntax is:
get Rezzer(handle,<name>,<type>)
The <name> parameter should be the name or id of the resource.
The <type> parameter should be a four letter resource type, eg PICT.
styleInfoThe syntax is:
get Rezzer("styleInfo",<name>)
The <name> parameter should be the name or id of the TEXT/styl resources to look at.
Because styled text can contain a number of text runs with different fonts, sizes and styles, the XFCN actually only returns the style of the first character in the text. To get more detailed information about a TEXT/styl resource pair, use the getField command to copy it into a text field, then use standard hypertalk commands to examine the field.
Example script for styleInfoon mouseDown ask "Which TEXT resource?" with "another test" get Rezzer(styleInfo,it) answer it end mouseDown
existsThe syntax is:
get Rezzer("exists",<name>,<type>,<here>)
The <name> parameter should contain the name or id number of the resource to look for.
The <type> parameter should contain the type of the resource, ie PICT.
The <here> parameter should be true if you want to look only in the current stack. If it is false, all stacks in the inheritance path are searched.
Example script for existson mouseDown ask "Name or id?" if it is not empty then put it into name ask "Type?" if it is not empty then put it into type answer "Search" with "This stack" or "Everywhere" put (it is "This stack") into inOne get Rezzer(exists,name,type,inOne) if it then answer "Resource was found" else answer "Resource was not found" end if end if end if end mouseDown