[Tcladdressbook-commits] Help tcladdressbook.n,NONE,1.1
Status: Alpha
Brought to you by:
bdesgraupes
|
From: <bde...@us...> - 2004-01-08 10:36:57
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv30761/Help Added Files: tcladdressbook.n Log Message: Man page. First checkin --- NEW FILE: tcladdressbook.n --- .de uline \Z'\\$1'\v'.25m'\D'l \w'\\$1'u 0'\v'-.25m' .. .TH tcladdressbook n "" "2004-01-08" "Extension for Tcl" .\" :Title: Tcladdressbook Help .\" :Project: addressbook extension for Tcl .\" :Author: Bernard Desgraupes <bde...@ea...> .\" :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> .\" :Modified: 2004-01-05 06:42:28 .SH NAME .PP addressbook - manipulate the Macintosh OSX Address Book database .SH SYNOPSIS .PP \fBpackage require addressbook\fP .PP \fBaddressbook subcommand\fP ?\fI arg arg\fP...? .SH INTRODUCTION .PP The argument \fI subcommand\fP indicates what operation to perform. Any unique abbreviation for each subcommand is acceptable. The valid subcommands are explained in the next sections. .SH SUBCOMMANDS .PP .SS addressbook changed .PP This command returns 1 if there has been changes made to the database, 0 otherwise. Changes are made in memory with commands such as \fBaddressbook set\fP, \fBaddressbook create\fP, \fBaddressbook delete\fP. To make these changes permanent, one must call the \fBaddressbook save\fP command. .SS addressbook count (-groups | -persons) ?-ingroup \fI groupID\fP? .PP This command returns the count of existing groups or persons in the database. One can specify a particular group with the -ingroup option to count only the subgroups or members in this group. .SS addressbook create (group | person) \fI name\fP ?-ingroup \fI groupID\fP? .PP This command lets you create a new group or a new person record. The \fI name\fP argument is the name to give to the new group or the last name of the person for which a new record is created. With the \fI -ingroup\fP option one can make the newly created record a subgroup or a member of the particular group with unique ID \fI groupID\fP. If no error occurs, the command returns the unique ID of the created record. .SS addressbook delete \fI recordID\fP ?-fromgroup \fI groupID\fP? .PP This command removes the record with unique ID \fI recordID\fP from the database or from a particular subgroup specified by its unique ID with the \fI -fromgroup\fP option. Note that any changes made to the database won't be definitive until you invoke the \fBaddressbook save\fP command. .SS addressbook export \fI personID\fP .PP This command lets you export the record with unique ID \fI personID\fP as a VCard. The result should be considered as binary data since it can contain an image associated to the record. .SS addressbook getme .PP This command returns all the data available in the database concerning the logged-in user ("Me"). The returned value takes the form of a keyed list: see the \fBaddressbook record\fP command for a description of this format. Keyed lists can be easily manipulated with the \fBkeylget\fP and \fBkeylset\fP commands defined in the TclX extension. .SS addressbook groups ?-ids? ?-ingroup \fI groupID\fP? .PP This command returns a list of all the existing group records: if no option is specified, it is a list whose elements are sublists made of two elements. The first element is the unique ID associated with the group and the second is its name. If the \fI -ids\fP argument is specified, the returned list will contain only the unique IDs of the groups. If the \fI -ingroup\fP option is specified, only the subgroups contained in the group with ID \fI groupID\fP will be returned. .SS addressbook image \fI personID\fP ?\fI imageData\fP? .PP If no \fI imageData\fP argument is specified, this command returns the custom image associated with the record corresponding to the unique ID \fI personID\fP. The returned bytes are binary data. If no image exists, it raises an error. If an \fI imageData\fP argument is specified, it should contain valid binary data defining an image which will be associated the record with unique ID \fI personID\fP. .SS addressbook import \fI vCardData\fP .PP This command imports data in VCard format. The data specified by the \fI vCardData\fP argument must be valid data in VCard format: a new record is created in the database corresponding to the information contained in the VCard. Note that the data can be binary if the VCard contains an image. .SS addressbook parents ?-ids? \fI recordID\fP .PP This command returns a list of all the groups the record with unique ID \fI recordID\fP belongs to. The elements of this list are sublists made of one or two items: the unique ID and, possibly, the name of the record if this field exists. If the \fI -ids\fP option is specified, only IDs are returned. .SS addressbook persons ?-ids? ?-ingroup \fI groupID\fP? .PP This command returns a list of all the existing person records: if no option is specified, it is a list whose elements are sublists made of one or two items: the unique ID and, possibly, the name of the record if this field exists. If the \fI -ids\fP argument is specified, the returned list will contain only the unique IDs. If the \fI -ingroup\fP option is specified, only the members belonging to the group with ID \fI groupID\fP will be returned. .SS addressbook property names (-groups | -persons) .PP This command returns a list of all the properties defined in the database for group or person records. New properties can be created or removed with the \fBaddressbook property add\fP and \fBaddressbook property remove\fP commands. .SS addressbook property type (-groups | -persons) \fI propName\fP .PP This command returns the type of the property specified by the \fI propName\fP argument. The returned type is one of the values listed with the \fBaddressbook property add\fP command below or \fI Unknown\fP. .SS addressbook property add (-groups | -persons) \fI propName\fP \fI propType\fP .PP This command lets you add a new property to the database, either for person or for group records. The name of the new property is specified by the \fI propName\fP argument: it must be unique. One can get the list of all the existing properties with the \fBaddressbook property names\fP command. The type of the property is specified by the \fI propType\fP argument. This argument can have one of the following values: \fI Array, Data, Date, Dictionary, Integer, Real, String, MultiArray, MultiData, MultiDate, MultiDictionary, MultiInteger, MultiReal, MultiString.\fP .SS addressbook property remove (-groups | -persons) \fI propName\fP .PP This command lets you remove a property from the database, either for person or for group records. The name of the property is specified in the \fI propName\fP argument. One can get the list of all the existing properties with the \fBaddressbook property names\fP command. .SS addressbook record \fI recordID\fP .PP This command returns all the data available in the database concerning the record with unique ID \fI recordID\fP. The returned value takes the form of a keyed list. .PP The format used for a particular property's value depends on the type of the property (string, integer, date, multivalue etc.). Some properties have a multiple type: MultiString for fields like Email, Phone etc., MultiDate for fields like ABDate, MultiDictionary for the Address field. In case of a multivalue, the returned value is a keyed list itself. Each element of the list corresponds to a single property. For instance: .RS .IP * 4 the elements of a MultiString or MultiDate value list are two-elements sublists: the first element is the label of the corresponding property (like Home, Work etc.) and the second is the value itself. .IP * 4 the elements of a MultiDictionary value list are lists themselves, representing a Label/Dictionary pair (dictionary in the AddressBook sense, not a Tcl dictionary as defined in version 8.5 of Tcl). Each element of this list has two elements: the first one is the label describing the address (like Home, Work etc.) and the second one is a list representing the dictionary. The lists representing dictionaries contain two-elements sublists: the first item is the key in the dictionary and the second one is the value associated with this key. For instance a person could have two addresses: each address will be returned as a Label/Dictionary pair; the elements of the dictionary are pairs like {City Paris} or {CountryCode fr}. .RE .PP Dates are returned as values suitable for use with the \fBclock format\fP Tcl command. It is the number of seconds relative to "Thu Jan 01 00:00:00 CET 1970". .PP Note that keyed lists can be easily manipulated using the \fBkeylget\fP and \fBkeylset\fP commands defined in the TclX extension. .SS addressbook save .PP This command lets you save the changes made in the database. Commands such as \fBaddressbook set\fP, \fBaddressbook create\fP or \fBaddressbook delete\fP modify the data in memory: to make the changes definitive in the database, one must call explicitely the \fBaddressbook save\fP command. To check whether there has been changes in the database, use the \fBaddressbook changed\fP command. .SS addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? \fI property op value\fP .PP This command returns all the records corresponding to the criterion described by the last three arguments: .RS .IP * 4 \fI property\fP is the name of the property you are searching on. .IP * 4 \fI op\fP is an operator specifying the type of comparison. It can be one of the following symbols: .RS .nf .sp ==, !=, <, <=, >, >=, ^= .fi .RE .sp which may have different interpretations depending on whether the value is numeric or is a string. .IP * 4 For a numeric value, they correspond respectively to: .RS .nf .sp == Equal != Not Equal < Less Than <= Less Than or Equal > Greater Than >= Greater Than or Equal ^= not applicable .fi .RE .sp The .RS .nf ^= .fi .RE operator is not applicable (and will default to Greater Than or Equal). .IP * 4 For a string value, they correspond respectively to: .RS .nf .sp == Equal != Not Equal < not applicable <= not applicable > Contains Substring >= Contains Substring ^= Prefix Match .fi .RE .sp The .RS .nf < .fi .RE and .RS .nf <= .fi .RE operators are not applicable and will both default to Equal. .RE .IP * 4 the argument \fI value\fP is the value you are searching for. In the case of a simple property, \fI value\fP will be a simple string. In the case of a MultiString, MultiInteger or MultiDate property, \fI value\fP will be a two-elements list representing a label/value pair. In the case of a MultiDictionary property, \fI value \fP will be a two-elements list representing a label/dictionary pair, the dictionary itself being a two-elements list representing a single key/value pair. For instance: .RS .nf .sp {Phone "01 02 03 04 05"} {Home {City Paris}} .fi .RE .sp .PP One can specify an empty string for the label in order to perform the search over all the possible labels. One can also specify an empty string for the key in order to perform the search over all the possible keys in a dictionary. .PP The \fI -groups\fP or \fI -persons\fP options let you specify the kind of records you want to search. If it is not specified, the default is \fI -person\fP. If the \fI -ids\fP option is specified, only IDs of the matching records are returned, rather than pairs made of the ID and the name. The \fI -nocase\fP argument concerns string comparisons and requires that no distinction be made between uppercase and lowercase letters. .PP To get a list of all possible properties, use the \fBaddressbook property names\fP command. To know the type of a particular property, use the \fBaddressbook property type\fP command. .SS addressbook set \fI recordID propertyName\fP ?\fI value\fP? .PP This command lets you get or set the value of a particular property for the record with unique ID \fI recordID\fP. If the \fI value\fP argument is not specified, it returns the current value of the property specified in the \fI propertyName\fP argument. If \fI value\fP is specified, the property \fI propertyName\fP will be set to this value. See the \fBaddressbook record\fP command for a description of the format used for the various kinds of properties. .SS addressbook type \fI recordID\fP .PP This command returns the type (ABPerson or ABGroup) of the record with unique ID \fI recordID\fP. .SH INSTALLATION .PP The extension is made of two files: the dynamic library (called addressbook1.0.dylib in version 1.0) and a file pkgIndex.tcl necessary for Tcl to be able to locate the extension upon request. Both files are contained in a folder called, in version 1.0, TclAddressBook1.0. This folder should be installed on your system in /Library/Tcl or in ~/Library/Tcl or, more generally, in any folder contained in your \fBauto_path\fP Tcl variable. If you use the extension within the AlphaX editor (version 8.0b11 or greater), you can also install it in the \fI Tclextensions\fP folder which is located at the same level as the application. .SH VERSION HISTORY .PP .RS .IP * 4 1.0 - - .RE .SH REQUIREMENTS AND PORTABILITY .PP This extension is only useful on Macintosh platforms. Version 10.2 or greater of the system is required: the AddressBook framework was introduced in version 10.2 of the System (aka Jaguar). .SH KNOW ISSUES .PP Please e-mail any bug or problem you encounter: <bde...@us...> .SH LICENSE AND DISCLAIMER .PP This software is free software and distributed under the same licensing terms as the Tcl language itself. See license.terms in the Tcl distribution. .PP © Copyright Bernard Desgraupes 2003-2004 .SH SOURCE CODE .PP Tcladdressbook is an Open Source Project. Its source code is public and can be found on the SourceForge site at the following address: <http://sourceforge.net/projects/tcladdressbook> .PP Tcladdressbook binary releases are available at <http://sourceforge.net/project/showfiles.php?group_id=96169> or on my web page at <http://webperso.easyconnect.fr/bdesgraupes/tcl.html> .PP The code is under CVS control. You can retrieve the latest stage of development using any CVS client. See instructions at: <http://sourceforge.net/cvs/?group_id=96169> .PP You can also browse the cvs repository online at <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook> .SH CONTRIBUTIONS .PP Code contributions (Tcl scripts making use of the Tcladdressbook extension) are very welcome. There is a "Contribs" directory in the Tcladdressbook project on SourceForge for code contributions. They must be free software, distributed under an Open Source license acceptable by the SourceForge site (for instance, the same licensing terms as the Tcl language itself). .SH SEE ALSO .PP See the TclX extension for keyed lists. See the Mk4Tcl extension for commands to open directly the database file. .SH KEYWORDS .PP Address book, data base. .PP \l'70\(ul' .PP |