GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Editing a MS-DOS batch function

A while ago I created a new button on my toolbar called "Foo". (Well not actually Foo, but you know what I mean). Now I've decided to make a slight change in how that button works. I've figured out how to do this in a round about kind of way. I found a file in my C:\Users\MyAccount\AppData\Roaming\GPSoftware\Directory Opus\UserCommands folder called "Foo.ouc". So I simply edited the dos command inside that file and that worked (at least after the next time I restarted dopus). However I am pretty sure when I originally created this button, I modified it a few times and I did it inside dopus and that I didn't even know about this file. Probably I just forgot how to edit the command.

What I'm trying now, is to right click on the toolbar, and select "customize".
Then I right click on my button and select "edit".
In the command editor, after "Function" it just says "Foo".
If I click on "Advanced", then after "Function" it says "Standard Function (Opus or external)" and below that is a window that just contains the single word "Foo". There is a little arrow in the heading above that called "Edit", but when I click on it, it doesn't show my dos command or give me a way to edit it.

I suspect I'm not supposed to edit my command by editing this file, and that I simply forgot how to do it the proper way. If so however couldn't find the answer in the manual or even by searching the forum. Can anyone remind me how to do this?

Thanks
~Paul

The reason you're seeing what you're seeing is because the "thing" running the actual commands is not directly in the button... you must have also created an Opus "User Command" called "foo" - which is what you're editing offline by modifying that foo.ouc file. Sounds like you then added the "foo" command to the button. Not sure if there was a particular reason you originally went that route, maybe you can just put those actual commands into the button...

As it stands... to edit what the "foo" User Command is doing without directly editing the file - you still go into Customize mode - and in the Customize dialog itself on the "Commands" tab expand the "User-defined Commands" category and find your "foo" command end edit it there.

Ok thanks steje. Yes it was a User Command, although I didn't realize it. Now I can edit it as you instructed. I'm sure that's the way I did it the first time since I would never have known how to type in the xml commands directly into the ouc file. I'm not sure what led me to the User Command method. Perhaps because I used some feature of it that was not available with the straight MS-DOS batch function. (I did have the runmode set to hide). Equally likely I was led that way by not knowing what I was doing :slight_smile:

By the way, the button I developed is one that mimics the DOpus Dos button, although quite a bit more sophisticated since it calls "DosBox" a 3rd party utility. One thing it can do is to run old (i.e. 16 bit) dos utilities, something the dopus dos button can't do (at least on Win 7-64). Many other enhancements as well.

The button code ultimately became somewhat complicated to get perfect. Is this something worthwhile submitting to the archive of user created enhancements (if indeed there is such an archive?)

~Paul

You never have to edit the XML files directly. The user command you had must be because you created a user command in the past, in the same part of the Customize dialog that Steje mentioned where you can edit the existing command (or create new ones). You just don't remember creating it. :slight_smile:

If you find it useful, then certainly someone else may find it to be so as well... go for it! Explain why it's useful and others may appreciate it.

My two cents: If you're only running the "foo" command - and nothing else in the actual "button" though - I'd encourage you to just copy and paste the User Command "code" you created directly into the button. You certainly don't need to change it - but if you're inclined to share it with other users, I don't see the need to send them on a multi-step process to copy what you've done when you can just use the steps from this sticky post to post a complete button definition they can easily add to their toolbars with a minimum of clicks...