This script allows the user to graphically select two data points. A line will 
then be drawn between them and the slope and y-intercept values will be displayed 
as a text label on the graph. 

Save the downloaded file, Pick2Points.ogs, in your Origin root folder. 

To run the script, you can open the Script Window by selecting Window:Script Window 
and typing the following: 
run.file(Pick2Points.ogs) 
Then press Enter. 

You can associate this script with any of the user-defined toolbar buttons. Select 
View:Toolbars to open the Customize Toolbar dialog. On the Button Groups tab, select 
the User Defined group. Now choose one of the 10 buttons. With one of these buttons 
selected, click the Settings button. For the File Name enter Pick2Points.ogs. Leave the 
Section Name and Argument List blank. (Tool Tip Text and Status Bar: You can enter whatever 
text you want displayed in the Status bar as well as when you mouse over the button.) 
For Context, leave Window selected. Uncheck everything except for Graph. The button is 
then enabled only when you have a graph as the active window. 

Drag this button out to the Origin workspace. You can also dock it on any of Origin's other toolbars. 

When the script runs, the Data Reader tool is enabled and allows the user to 
pick 2 points. Once these 2 points are picked, the line is drawn between them 
and the slope and y-intercept values are displayed as a text label in the graph. 
