What is Script Editor?
Overview
Lightning Review provides an API so that users can develop their own functions (extensions).
(For details, see the following link: API Reference)
In the script editor, you can write and run scripts to operate Lightning Review using this API.
- Useful for automating operations that cannot be performed from the Lightning Review screen or for automating processes.
Example: Bulk editing of review file templates, filtering of issues under special conditions, etc. - Scripts created can be easily shared with team members.
To develop an extension, you need some programming knowledge of the C# language, and it is time-consuming to create a NuGet package. With the Script Editor, even those with introductory level knowledge of C# can realize "simple functions" by relying on the input support function (IntelliSense).
Installation
-
Click [Tools] menu - [Manage Extensions] to launch the [Manage Extensions] dialog.
-
Select the following individually from [DENSO CREATE Official] and install them.
- LightningRevie.Interop
- ScriptEditor

-
Click the [Install] button.
-
Restart Lightning Review.
To display the explanation of methods and properties in the input assistance function, you need to install .NET 6 SDK.
You can download the .NET 6 SDK installer from the following link: "Microsoft site"(https://dotnet.microsoft.com/ja-jp/download/dotnet/6.0)"
How to use
Here is how to use the script editor.
First, display the [Lightning Review Script Editor] dialog from the [Tools] menu - [Script Editor].
The following screen will be displayed.

Preparation
Click "Open Folder" and specify the destination for the output file of the script editor.
All files explained below are files stored in the folder specified here.
C:\Users(user name)\AppData\Local\DENSO CREATE\Lightning Review ScriptEditor\Scripts
Writing the script
After that, write the script as shown in the video below and execute it.

- Write the script you want to execute in the "Editor" pane of the script editor.
- Click "Save".
Executing a script
- Display the "Lightning Review Script Editor" dialog.
- Double-click the script you want to execute in the "Explorer" pane to open it.
- Click "Execute Script" to execute the script written in the "Editor" pane.
Sharing a script
You can share scripts created among members.
You can refer to scripts created by others in the following way.
- When you write and save a script, a file with the extension "csx" is created.
- If you store the above file in the folder specified in "Open Folder", the file will be displayed in "Explorer".
How to write a script
Write the script as follows. For details, please refer to the following link.
- How to write (C#): "Script creation and command line execution example"
In the "Editor" pane, you can use the input assistance function like Visual Studio.
- API to call: "API list"
Sample
As an example of how to write a script, the code for "Add members to template file in bulk" is shown below.
For details, see the following link. : Sample list
//If there are dozens of unfixed issues, you can filter to display only those that should be fixed as a priority.
//As an example, we are applying a filter that displays only issues that meet the conditions of "high priority," "unfixed status," and "unspecified fixer."
//Set the member name you want to add below
var memberNames = new [] {"Kondo"};
//Set the folder containing the template file you want to add below
var templateFolder = @"C:\Git\lightning-review-operational-test\Docs\Engineering\Current\07_PeerReview\Templates";
var directoryInfo = new DirectoryInfo(templateFolder);
var files = directoryInfo.GetFiles("*.revx");
var service = App.GetReviewFileService();
foreach(var file in files)
{
var review = service.OpenReview(file.FullName);
foreach(var memberName in memberNames)
{
//Add member
var newMember = review.ReviewSetting.AddMember(memberName);
newMember.Reviewee = true;
newMember.Reviewer = true;
newMember.Moderator = true;
}
//Save and close
service.SaveReview(file.FullName, review);
service.CloseReview(review);
}
Notes on running scripts
Notes on running the script editor.
-
Do not close the script editor while the script is running.
If you close it, the process will be interrupted. (No error will be displayed.) -
Keep the running script editor active while running a script from the command line.
If you switch to another window during the process, the active window may be processed. -
Close the review file when updating the review file from the script editor.
If you want to get information about the review file, it is okay to have the file open. -
If you want to run the script periodically using the Windows Task Scheduler, make sure that the user is logged on.
If you are logged on, there is no problem even if you have locked the screen using the Windows screen lock function.