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.
The 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.
The 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.
on mouseUp ask "Type?" if it is not empty then ShowResult "Resources of type " & it,Rezzer(all,it) end if end mouseUp
The 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.
on mouseUp ask "Type?" if it is not empty then ShowResult "Resources of type " & it,Rezzer(list,it) end if end mouseUp
The syntax is:
get Rezzer("types")
The result is returned as a comma-delimited list of resource types.
on mouseUp ShowResult "Resources types in stack",Rezzer(types) end mouseUp
The 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.
on 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
The 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.
on 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
The 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.
The syntax is:
get Rezzer("alltypes")
The result is returned as a comma-delimited list of resource types.
on mouseUp ShowResult "All resources types in path",Rezzer(allTypes) end mouseUp
The 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.
on mouseDown get Rezzer(getField,"another test","text",true) end mouseDown
The 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.
on mouseDown get Rezzer(storeField,"another test","text",true) end mouseDown
The syntax is:
get Rezzer("getText",<resource>)
The <resource> parameter should contain the name or id of the TEXT resource to store the text in.
on mouseDown put Rezzer(getText,"another test") end mouseDown
The 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.
on mouseDown get Rezzer(storeText,"another test",bg fld "text") end mouseDown
The 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.
The 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.
on mouseDown ask "Which TEXT resource?" with "another test" get Rezzer(styleInfo,it) answer it end mouseDown
The 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.
on 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