2 Replies Latest reply on Nov 2, 2010 12:58 PM by Willam van Weelden

    MapIDs - How to make them the same as the Filename.htm?


      Hi All,


      I'm fairly new to Robohelp, hoping the experts can take it easy on me!


      We're in the process of converting our old WinHelp projects to Microsoft HTML Help projects. We previously had 10 separate .HLP files for our project, we're hoping to condence all of those into a single CHM file.


      In our previous projects, our MapIDs were as follows from the .HH file:


      #define HELP_Add_Cables    6171
      #define HELP_Add_Column    6181
      #define HELP_Add_Control_Unit    6537
      #define HELP_Add_Copy    17043



      After converting our projects from WinHelp->MS HTML Help, each one of these topics created a new HTM file, ie: "Help_Add_Cables.htm", fine, no problem. But when I bring up the "Edit Map IDs" dialog, its now showing me the Topic ID ("How to Add Cables"), and not the HELP_XXX_XXX name that is used throughout our product. As a result, we would have to go through our source code and update approximately 1000 Map IDs - yuck!


      Is there a way to force this dialog to use the Filename, and not the Topic Name to generate the .h file? Is there some fancy editing I can do in Ultraedit instead of using Robohelp to get the result I want?


      I notice there is an alias file as well, that appears to correspond between the Topic Name, and the .HTM Filename.


      We were previously using Robohelp 5.xx, and recently upgraded to


      Anyhelp you could provide would be greatly appreciated.




        • 1. Re: MapIDs - How to make them the same as the Filename.htm?
          Willam van Weelden Adobe Community Professional & MVP



          The .h file contains the TopicId's and the MapId's. TopicId's are used by Robo to link a map a MapId (numeric) to a topic. The mapping of the topic Id's is done in the alias file. Both files are just plain text, so you can create a script to automatically create the context sensitivity for you. For example, you can use the RH script editor to create/update your context sensitivity.


          BTW. You say your RH version is 8.0.1. There's an ugly bug in that version so update to 8.0.2 as soon as you can. (See snippet 19 on http://www.grainge.org/pages/authoring/rh8/using_rh8.htm).





          • 2. Re: MapIDs - How to make them the same as the Filename.htm?
            Willam van Weelden Adobe Community Professional & MVP



            I created a small RH script that quickly assigns TopicId's and mapnumbers to your topics, based on the filename. Hope it helps.


            First, the script adds a map file called 'RHScriptMapFile'. No checks whether it exists or not.

            Then, creates a TopicId for each topic based on the file name. It just strips the '.htm' from the filename and replaces spaces in the name with underscores. A sequential mapid is added. The script is nothing fancy, but I hope it shows how you can quickly create a script that will save you from changing a thousand id's by hand.


            function CreateContextSensitivity() {

               var MapManager = RoboHelp.project.MapIdManager;

                 var MapfileName = 'RHScriptMapFile';
                 MapManager.setCurMapFile(RoboHelp.project.path+'\\'+MapfileName+ '.h');

                 var topicmanager = RoboHelp.project.TopicManager;
                 for(var i=1;i<=topicmanager.count;i++)
                      topic = topicmanager.item(i);
                      var TopicId = GetTopicId(topic);
                      MapManager.newMapId(TopicId, i);
                      MapManager.assign(TopicId, topic.path);
                 alert('Context sensitivity created in map file '+MapfileName);
            function GetTopicId(topic) {//Get the topic id based on the filename
                 var FileEnd = /\.htm/g;//Strip .htm from the filename
                 var Forbidden = /( )/g;//Strip forbidden characters from the filename.
                 var ID = topic.filename.replace(FileEnd, '');
                 return ID.replace(Forbidden, '_');