Can anyone tell me how to add in a button(or menu option) with Origin 5.0? I am only just starting to try and write script. I am confused by the manuals I have and nothing I've tried works.
You need to look at the LabTalk Resources page. Here you'll find lots of useful sample scripts to get you started.
The information below comes from the on-line help, searching on 'button'.
Buttons can be created from any label. In the following example, you create a button from a text label and define the button to open a dialog box containing the message "Hello World!".
Creating the Text Label
1) Click the New Graph button on the Standard toolbar to open a new graph window.
2) Open the Tools toolbar by selecting View:Toolbars. Select the Toolbars check box and click Close. 3) Select the Text tool from the Tools toolbar.
4) Click in a blank area of the graph window. This action opens the Text Control dialog box. Type Hello in the text box. 5) Click OK to close the dialog box. The Hello text label displays on the screen.
Changing the Label into a Button
1) Select Edit:Button Edit Mode to enter Button Edit Mode. This menu command is checked when in Button Edit Mode. 2) Click once on the Hello text label to select it, then select Format:Label Control. This menu command opens the associated Label Control dialog box. 3) Click in the text box at the bottom of the dialog box and type in the following text (this is the script for the control):
type -b "Hello World";
Selecting the Script Execution Option
1) Select Button Up from the Script, Run After drop-down list.
The Button Up option informs Origin that the script is executed when the button is clicked. Each of the options from the Script, Run After drop-down list establish a different method for script execution. For example, select Moved to execute the associated script when the text label is moved.
2) Click OK to close the dialog box. If you are in Button Edit Mode, select Edit:Button Edit Mode to exit the editing mode. The Hello text label now displays on your screen as a button. When you click the button, an Attention dialog box opens and displays "Hello World!". 3) Click OK to clear the Attention dialog box from the screen.