Hi Daniel,
There are examples on this LabTalk Scripting Guide wiki page:
http://wiki.originlab.com/~originla/wiki/index.php?title=Script:Getting_Points_from_Graph
Version 8.1 ships with a printed form of the LabTalk Scripting Guide.
I took one of the examples from there and modified to screen reader. so in the code below, the x value at the point clicked is used, and then the y value of the active curve in the graph is found using interpolation with the %c(x) syntax. This syntax does interpolation as needed to find the y, as the x chosen can be an arbitrary value and not a point in the curve.
Easwar
OriginLab
dataset dsx, dsy; // Create two datasets to hold the X and Y values
dotool 2; // Start the screen reader tool
// Define the macro that runs for each point selection
def pointproc {
count++; // Increment count
dsx[count] = x; // Get the X coordinate
dsy[count] = %c(x); // Get the Y value of active curve using interpolation
}
// Define a macro that runs if user presses Esc key,
// or clicks the Pointer Tool:
def quittoolbox {
count=;
for(int ii=1; ii<=count; ii++)
{
type $(ii), $(dsx[ii]), $(dsy[ii]);
}
}
count = 0; // Initial point
type "Click to select point, then press Enter";
type "Press Esc or click on Pointer tool to stop";