dim cmd
cmd = data.AddCommand()
cmd.name = "Test"
cmd.method = "Test"
cmd.desc = data.desc
cmd.label = "Test"
End Function
Function Test()
dim objCmd : Set objCmd = DOpus.NewCommand
objCmd.RunCommand("Play ""F:\My Office Data\sounds\test.wav"" QUIET")
Set objCmd = Nothing
End Function[/code]
Please read this help page to learn how to create a script Add-in: Script Add-ins
Following the instructions you'll get something like this for your test script:
[code]option explicit
' Test
'
'
' This is a script for Directory Opus.
' See http://www.gpsoft.com.au/DScripts/redirect.asp?page=scripts for development information.
'
'
'
' Called by Directory Opus to initialize the script
Function OnInit(initData)
initData.name = "Test"
initData.desc = ""
initData.copyright = ""
initData.version = "1.0"
initData.default_enable = false
' Implement the Test command
Function OnTest(scriptCmdData)
dim objCmd : Set objCmd = DOpus.NewCommand
objCmd.RunCommand("Play "F:\My Office Data\sounds\test.wav"" QUIET"" QUIET")
Set objCmd = Nothing
End Function[/code]
[quote="jon"]If you turn on the log you'll see your script produces an error:
[/quote]
Just wondering. How do you do that on a fresh install nowadays? I remember having to look through all the
menus and whatnot without success, then creating items for it myself.
Considering how "important" scripting has become in DO lately it might be preferable if there were
easily accessible menuitems for cli scripting, scripting page, and the scripting log from the get go.
Or anything else which opens the Utility Panel, then switch which panel is being shown from the drop down at the top of it.
None of this stuff is particularly hidden in the UI or the manual, especially for the type of people technical enough to write scripts. None of it is that useful to people who only want to use scripts and not write them. So it seems OK as it is to me.
Or anything else which opens the Utility Panel, then switch which panel is being shown from the drop down at the top of it.[/quote]
Ah, there it was. It isn't exactly the most logical place to look for it.
Considering the lack of a View menu, I would've thought it logically belonged under tools.
My suggestion stands though.