This topic explains how to locate scripts by messages they display, or by labels on the dialog boxes, through a search in Visual Studio Express.
Note: See Find which GN4 script runs when you do something to learn how to get to know the right name.
Locate definitions by messages/labels through Visual Studio search
1.Launch Visual Studio Express add-ins solution.
2.Press SHIFT+CTRL+F to display Find in files dialog box, and then, in Find what, enter the name of the message or label you are looking for.
3.In Look in list, select Entire Solution.
4.Select Include sub-folders.
5.Under Find options, clear all options.
6.In Look at these file types, enter *.* or leave it empty.
7.Click Find all to display results.
The Find Results pane will show all occurrences of found items, with the full path of the file where it was found.
On the following screenshot, we searched for the label Add rules when splitting on the Split sub tab of the Extra tab on the Preferences dialog box on the Pages main tab:
Results include add-ins only.
To go to the related line
On the Find Results pane double-click the line to bring the entire code in the view.
Locating variables and scripts related to the message/labels
When you search for labels on the dialog boxes, you will find them in the resources files. The following label was found in the ExtPreferences.resx file:
As the place doesn't tell us much about the name of the variable or from which script is called, now repeat the search by using the name of the dialog item, e.g. chkAFCS_VRules and look for something similar to this assignment:
C:\tera\gn4\main\src\GN4AddIns\FredSystemAddIn\Fred.vb(1593): form.chkAFCS_VRules.Checked = SystemUserOptions.AFCS_VRules
In other words, look for the line where the name you were looking for appears near to an equal sign. On the example above, it is:
form.chkAFCS_VRules.Checked = SystemUserOptions.AFCS_VRules
Now, you know the name of the variable that is: SystemUserOptions.AFCS_VRules.
See also
Simple scripts, Scripts that call other scripts and Scripts where the main action is executed elsewhere
Find which GN4 script runs when you do something
And also
Locate configuration items and scripts through Visual Studio Express search
Locate configuration items through Visual Studio Express search