Is it possible to run a Script from a file

Greetings
Is it possible to run a script from a file?
Many thanks for any replies

If you create a script in a button you can drag and drop that button to (e.g.) your desktop in Customise mode. This will create a DCF file that can be double clicked to execute the script.

That could mean many things. If aussieboykie's answer doesn't solve things for you, can you give an example of exactly what you want to do? What kind of script? How do you want to run it from the file? (Double-clicking the file?)

Instead of vbscript living here it lives in a file on the disk.
Then from this dialog a pointer to the vbs file to run.
similar to if you had a command to open a certain file e.g. I have commands to open a certain spreadsheet.

You can almost get there by using script commands (which are provided by script addins).

These addins are external resources. The drawback is, that you'd need to wrap your button logic into a new command which might need some switches and so on. The benefit on the other hand is, that anybody is able to make quick use of what you came up with by just putting your addin into /scripts and putting "YourCommand SwitchA OptionB=none" into a button.

You can find dozens of script commands in the script addin area right here to see how it's been done.

Thank you tbone sir very much will research this thank you :relaxed:

What I should have asked is - what is the best and easiest method by which to develop and test scripts?
Answer = the CLI tool as pointed out by Leo here

Help link for Opus 12 is here
https://www.gpsoft.com.au/help/opus12/index.html#!Documents/CLI.htm

The CLI tool is handy for little, very specific tests. That's what I use it for at least. I remember going for the CLI in the beginning of my DO scripting attempts as well, it seemed to be the obvious choice but now I think (and got convinced) it's not.

What it does not offer is the same context and variables as a script button or script command and that's where I think it get's clunky if you try to develop a script or script button. You'd always need to prepare the same set of incoming variables to mimic the OnClick(clickData) function for example. It also does not evaluate returned values which are a necessity for some scripted events and so on.

Since DO v12 allows you to run script buttons without closing the whole customize mode down each time, it's definitely easiert to develop a script button in the button editor itself not using the CLI tool. For more complex scripts which provide scripted columns or commands, there's no way around a proper text editor, so again, the CLI is not the right tool.

But anyway, don't necessarily follow my words, make up your own mind! o)

Thanks tbone appreciate that feedback I am a bit lost otherwise.
I want to develop a fairly simple script and I find the process of repeatedly opening the button or custom command button very onerous.
That seems to be the only way...?
thanks again

As mentioned, you can run the button code directly in the button editor with v12 (use F5 or the "Run" button on the lower left).
There are situations where you still like to exit the customize mode (you like to use DO to lookup other script files e.g.), so you cannot stay in the button editor all the time, but nonetheless, it's quite nice for working on button scripts and has been wished for by users for some time.

One other thing, you can enter customize mode for a single button very quickly with the "Alt leftclick" feature. You need to enable that in the DO prefs.
Preferences / Toolbars / Options / Alt-Click to edit Toolbar buttons

Ah very nice!
Thanks tbone..