I have on my computer a file called "Opus 11 Scripting Reference.xlsx" (I may have renamed it), dated 19/12/13. It contains nine spreadsheets giving a systematic list of the objects, methods and properties of DOpus. It is a very useful resource, first because it is hierarchically organised, and secondly because when I search the standard "Help" file, online or on the computer, I get results from everywhere in the Help file, not just from the Scripting sections.
I assume that I downloaded the file from the GPSoftware website when DOpus 11 first appeared, but I can't find it anywhere there or on the forums. Is it still available, and if so, has it been updated as more has been added?
That's old and out of date, from the time of the early betas before the manual had been updated.
The Scripting Reference section of the manual has all you need and should be easy enough to navigate without needing to search, once you have a rough idea of what is there (which is best obtained by browsing through all the objects and events once).
Thanks Leo, that clears up the mystery. It's been useful to me, however, so I for one would welcome it if you have the time (which no one does) to update it.
The same information, with more detail, is in the manual.
Leo, "Search" has been unwieldy since scripting arrived. Perhaps the manual could be split into two — the original section for DOpus commands, and a second section for scripting. Or perhaps the search could have a switch:
- Search non-scripting sections
- Search scripting sections
- Search all sections
Specifically, I was trying to search the manual to see whether the DOS command "subst" had a JScript equivalent. This was very difficult because "drive" and "virtual" turned up a huge list, and "subst" turned up nothing.
Please, this is not in any way intended as a complaint, but simply as a suggestion for a smoother manual. A second point: The spreadsheet is excellent because it shows the hierarchy more clearly than the manual (I mean here only to a non-techie — many of us are first learning object-oriented coding from DOpus), but I'm sure that there are other methods.
Third point: The standard JScript manuals on the web such as http://tergestesoft.com/~manuals/jslang/jstoc.htm are organised into hierarchies, and they also give examples of the use of each method or property. I am deeply embarrassed about how many stupid things those many short examples have saved me from.
Were you searching the Excel sheet as well, or browsing down the small list of objects to look at any that looked related to the task at hand? That's how I use the manual.
There isn't much of an object hierarchy. Trying to organise the object into a hierarchy would be a mess as a lot of the objects can refer to each other, and there aren't any deep nestings.
My advice is to browse through the objects a few times and get a feel for what's there, and then you'll know where to look to see if and how they can help. There aren't many objects and what most of them do is in their names so it's (usually) easy to know if they're relevant just from the list of objects.
Separating the scripting objects into a separate manual would get in the way of the common case where you're writing scripts to run Opus commands and need quick access to both types of information.
Most of the filesystem related functionality added by Opus itself in under the FSUtil object. But that's just the stuff we felt the need to add. There is more functionality in the objects provided by Windows itself, and those are not be covered by the manual or the old spreadsheet.
Opus doesn't (currently, at least) add any subst functionality, so you're not finding anything in the search because there's nothing to find. There wouldn't be anything to find in an updated spreadsheet either.
Neither manual nor spreadsheet are intended to be references for JScript/VBScript themselves, nor for the many objects that Windows provides to do various things. To find out how to do subst in JScript I tried a web search, but I'm not sure there is a good answer out there. I found a suggestion to run the subst command itself from scripts, and info on how to map network drives from scripts (which isn't the same as subst). Better info may be harder to find because it doesn't exist, or maybe I haven't thought of what to search for.
Thanks, leo. It is difficult when you are learning on your own and confusing everything with all sorts of silly mistakes. Stack Overflow is indeed a wonderful source of advice, from the excellent to the very poor, and the constant arguments are always instructive.
As for Subst, I have already ended up using RunCommand to run the necessary DOS commands within a script. In particular, the only way I could produce a list of already-substituted drives was to redirect the bare "Subst" to a file, then read off the drives from the first two letters of each line of that file. Very inelegant, but it works.
My concern is the extremely steep learning curve presented by DOpus scripting that I experienced as a non-techie knowing nothing about objects. I seem to be over the worst hump now, and I reckon (I am a teacher) that I have a few concrete suggestions as to how my learning could have been made easier. The decisive step, however, was to have blokes like you and jon and tbone around to give a hand. I have appreciated that very much.
That's scripting, and programming, in general. Once you're familiar with things, it all gets much easier. The stuff that Opus adds on top of learning generic VBScript/JScript is small, but I can see how it might seem daunting when you're learning it all at once, especially as there isn't a good resource for everything in basic VBScript/JScript, let alone one that combine that with everything in Opus.
It is also a pain because both JScript and VBScript are rather limited compared to what you'd expect them to provide, and Microsoft gave up on them but didn't really replace them with anything (PowerShell can do more, but isn't a suitable replacement in a lot of situations, and has its own problems).
But they let you do a lot of things you couldn't do otherwise, and once you're up to speed it's not too bad.