Skip to main content

Add Comment to IDEA database

Background

This script gives an alternative way to add comments to your database while also allowing the option of adding the comment to the history.

Documentation

This script gives an alternative way to add comments to your database while also allowing the option of adding the comment to the history.

To make this script worth while you should create a ribon and attach the script to the ribbon for easy access.  In the example below I have created a Custom Macros ribbon with a Utilities category that I have attached the script, so it is now one click away.

If a file is open the script will use that file or you can select a different file.  You can then add your comment, indicate the importance.  I didn't bother to add a link to the comment as usually I only use these for the current database, if users think it is important that I add this please let me know.

It will also add your user name along with the current date and time.  The big difference with this is that you now have the option to add the comment to your history, that is one thing I find lacking with the comments as sometimes I would like to be able to add notes to the history directly which I can't from the comment section, this allows that option.  I also find the text box to enter comments sometimes clunky, the text bos in this script allows you to enter multiple lines, use the enter key for paragraphs and has a vertical scroll.

 

When you select ok, the comment and other information gets added to the comment section.

and if you selected to add it to the history you would get the following history entry:

I did find a bit of a bug with this.  If you try and add a comment when the history is open instead of the data it looks like the history doesn't get added to the file, but it does.  You need to close IDEA and open it again and the comments will be there.  Not sure why but it only seems to happen if you add a comment with the history open.

 

Derek Tue, 07/31/2018 - 22:32

Hi Brian,
Can we used script to get the comment information ?
Derek

Brian Element Wed, 08/01/2018 - 05:03

In reply to by Derek

Unfortunately not.  The comments are stored with the imd file and I have no way to access them.  When it gets written to history through an IDEAScript it is not saved in the project overview so you can't get it from their either even though I have asked CaseWare to add this in the future.  So right now there is no way to get comments that I know of.