Is it possible to get the cvtype of an object given only its displayname in Synergy?

Pawel Kopalko's picture

We have folders and tasks using the same naming convention, we basically operate only on these displaynames in GUI.

Now in scripting the CLI the things get a little bit more complicated, as a test has to be done to discern whether the displayname is of a task or of a folder. Is there a way via some sort of a query (or other command) to get such info not necessarily via cvtype, but in a manner that can be scripted. (cm Syn 6.5 and 7.1)


4 Answers

Robert Doerr's picture

You can easily query even on just the name and return the type: "ccm query -name foo -f %cvtype" or anything else you would like to retrieve. Returning the objectname would give you name, version, type & instance which might help.

Pawel Kopalko's picture

The problem is that it won't work in DCM enabled database, where the displayname of the task for instance consist of <database_ID><DCM_delimiter><task/folder_number>

Simple -name will not retrieve, sadly.

I have yet to try it on WAN client, but thanks for the information.

David Honey's picture

The short answer is "no".

The displayname depends on the type of the object. However, the displayname is not, by itself, unique in a database. Here are two examples:

1) Task 1 in database A will have a displayname of "A#1". Folder 1 in database will have a displayname of "A#1". So given a specification of "A#1", you have no idea whether it's the task, folder, or something else that might have that form such as a change request.

2) There are two different instances of a file named readme.doc: readme.doc:1:ascii:A#1 and readme.doc:1:ascii:A#2. Both will have a displayname of "readme.doc". Without knowing additional context, the displayname is not unique.

What Synergy does aim to do is that if for a known type you get its displayname, you can use the value of that pseudo-property as a specification for that type of object. For example, if a command accepts a [i]task_specification[/i] you should be able to use the displayname of a task for that specification to uniquely identify that same task.

If you want to use a form that can be used as a global form for [i]object_specification[/i] that is unambiguous use objectname not displayname.


Pawel Kopalko's picture

Thanks for the info David.


CMCrossroads is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.