How to edit and test a script

I'm trying to get a start on the scripting, but have some difficulties.. o)

How do you guys edit an onclick/inline button javascript?
The advanced command editor does not sport syntax highlighting nor appropriate tab handling for more serious editing (tab spacing = 8 chars?).

Then I remembered that "console" there is! The Command Line Interpreter Tool. There we have nice syntax colors, but still no usable tab-size of maybe 4 chars. But my biggest problem is, I do not have the context of a button-click anymore. So in case I try to create an onclick button script, it won't do a thing in the CLI tool, as I have no "clickData" available. Is it possible to edit a button script in an external editor, save it and run the updated script in DO when hitting my script-button? I don't think so?

In case I completly missed on how to have a smooth scripting experience, pls let me know!.. o) In case I edit event-based scripts, it seems to be more comfortable, I can use my external editor which is "pro" on editing source, just save the file and try the result in DO with its output window visible.

Thanks!

You could use the new scripting support, I realise this is not exactly what you asked.

For creating a script, that a button could call I:
[ul]
[li]Create the script file[/li]
[li]Open it in notepad++[/li]
[li]Make changes, and save file[/li]
[li]The script file is auto loaded, so you can create a button that runs the script for testing.[/li]
[li]Then I can keep making changes, save the script file and run via the button.[/li][/ul]

If you just want to see what some commands do, you can use the CLI tool.
Be interested to see how others work.

Hi Wow.. o)

Can you give some more details on where and what kind of script I shall create and how that is bound to a button?
Do you mean to create a custom script command, which is used in the button? In case you do, how do you get the clickData through, into the script?

Thanks!

See here: gpsoft.com.au/help/opus11/in ... Addins.htm

@tbone:

Read through the manual Leo pointed you to along with the Scripting Reference. But as a shortcut... where ClickData (and its Func child object) is available to buttons, ScriptCommands have an equivalent ScriptCommandData object (which also has a child Func object).

Yeah, I did, I did!.. o)

I'm making progress I think, because I was able to test drive some functions by abusing a ScriptCommand-setup to create and "develop" a single button script.
I expected single button scripts to be editable somehow "better", but if you do your code in an external Editor and once finished, copy the code into a button (changing function header as well), it seems to be managable. I did not realize at first, that the func-object is the key here (exactly what you point out), while incoming objects are different at "root".

While digging the manuals, I came across this: Do you think the marked comment is correct?



Thank you guys for getting me started.. o) I'm having fun.. o)
Rob.

I've put in a help-file fix for that. It should be a ScriptCommandData object which in turn contains a Func object.

Why is it actually, that you work on weekends? o)

Thanks! o)