Site Tools


New release available: 2020-07-29 "Hogfather". upgrade now! [51.3] (what's this?)
New release candidate 3 available: 2020-06-09 "Hogfather". upgrade now! [51.2] (what's this?)
New release candidate 2 available: 2020-06-01 "Hogfather". upgrade now! [51.1] (what's this?)
New release candidate available: 2020-06-01 "Hogfather". upgrade now! [51] (what's this?)
Hotfix release available: 2018-04-22c "Greebo". upgrade now! [50.3] (what's this?)


Method to get and set the context sensitivity for a topic. This method is the equivalent of the function topicCSH()


To get the topic ids and Map numbers assigned to a topic:

var tpmngr = currentProject.TopicManager;
for(var i = 1; i<=tpmngr.count; i++) {
  var topic = tpmngr.item(i);
  var topiccsh = topic.CSH();

To assign a topic id and a Map number to a topic:

topic.CSH("TopicId", 1);

To check that a topic has context sensitive help assigned:

var topiccsh = topic.CSH();
if(is_array(topiccsh)) {
  //Topic has CSH
} else {
  //Topic does not have CSH


  • When both the topic id and the Map number are not yet added to the project, the method will add the topic id and the Map number to the project.
  • When only the topic id or the Map number exist in the topic, the method cannot assign the CSH to the topic.
  • The method does not check whether the given topic id and map number are mapped to each other. The method assumed you created both ids correctly.


Parameter Data type Required Description
topicid string The topic id to assign to the topic
mapnumber string/number Required when topicid is set The map number to assign to the topic

Return values

Value Meaning
array The context sensitivity of the topic
true Ids were assigned to the topic
false This topic has not context sensitivity OR could not assign context sensitivity to the topic

Structure of Returned Array

When the return value of the paragraph is false, there is no context sensitivity assigned to the topic. When there is context sensitivity assigned, an array with the following structure is returned:

- Numeric array key
|- CSHTopicidKey
|- CSHMapnumberKey

Each numeric key in the array is an embedded array. You use global variables to get the desired key:


var topicmgr = currentProject.TopicManager;//Load the TopicManager. currentProject is a variable from the library
for(var i = 1; i<=topicmgr.count; i++) {//Loop through all topics
    var topic = topicmgr.item(i);//Save the current topic to a variable for easy access
	//Get the required array with Topic CSH. This returns an array with the mapnumbers and topic id's that need to be set for the topid.
	var curTopicCSH = topic.CSH();
    if(is_array(curTopicCSH)) {//Is CSH assigned?
        for(var j=0;j<curTopicCSH.lengh;j++) {//Loop through CSH keys
            //Print to RoboHelp Output View Pod by using the library's msg function
            msg('Topic: '' ID:'+ curTopicCSH[j][CSHTopicidKey] +'#: '+curTopicCSH[j][CSHMapnumberKey] );
csh/csh.txt · Last modified: 2020/02/26 17:10 (external edit)