DOpus CLI usage

Is there some trick to using the Directory Opus CLI to any effect? Is it not meant to actually operate on selected files (when issuing a DOpus command that would otherwise do so), or open dialogs via {dlgstring}, retrieve filenames via {file$}, etc.? Nothing happens for me, other than displaying the templates for commands (via “setattr ?”, etc.). I do have “Script interpreter” unchecked.

It's handy for trying things out. When you click the right facing arrowhead your code is immediately executed. I use it all the time when I am creating or updating scripts.

That arrow is disabled unless “Script interpreter” is checked. I’m not trying to use it for scripts, just internal DOpus commands.

For internal commands you can use the instant command interface. Just type > into the main file display, followed by the command you want to execute.

I have, but the ones I’ve tried have no effect, and return no errors either. For example, I’ve typed:

setattr meta "datetaken:+00:00:15"

Nothing happens.

That command works for me. If I display the datetaken column, select at least one image and then enter the command, 15 secs is added correctly.

I have no idea why, but it does not work here. I’m not displaying the datetaken column, though, but I wouldn’t expect that to be required for it to work.

I did, however, type “help” and it opened the help file. But that’s not something I need to experiment with.

Anybody else have any ideas?

If you don't mind me asking, how do you determine that it hasn't worked? The datetaken column gives an immediate indication. Might be worth adding while you are testing.

The Metadata Pane, the Set Metadata dialog, and simply hovering the mouse over the selected image file, all indicate no change was made to DATETAKEN.

Fair enough. There is always a short delay but should be no more than a second or two.

Does the same command work in a button?

The problem may not be how you are running the command.

Yes. This is the code I used:

@set time={dlgstring|Enter HH:MM:SS to bump:|00:00:00}
dopusrt /acmd SetAttr FILE {filepath$} META "datetaken:+{$time}"

Ok, so I think I may have at least partially figured out what the problem is. I very often have multiple DOpus Lister windows open, and did when I was trying to issue SetAttr META from the CLI. I just closed all but the one Lister window (with my test image files) and tried issuing the same commands that way, and it worked. I guess the DOpus CLI doesn’t know or track which window launched it? Is there some way to direct commands to a specific window?

The CLI will work on whichever window is source.

But if you do what aussieboykie said above, and run commands by typing > into the file display, then you don't have to worry about that. There isn't usually much reason to use the CLI for basic one-line commands these days; it's more useful for scripting and some fairly esoteric stuff, and the > key is better for running simple commands.

I must be missing something here. If I have two or more Lister windows open, and an image file selected in the source pane of one of them, and I use THAT window’s menu to open the DOpus CLI, and I type SetAttr META "datetaken:+0:0:75" in the CLI and press ENTER, nothing happens to the selected image file. If I close all Lister windows other than the one with the selected image file in the source pane, and otherwise do the same as above, the command works. If the CLI is supposed to work on whichever window is source, why does having two or more Lister windows open keep it from working?

As for typing > in the actual Lister window, I wasn’t previously aware that could be done (I initially thought aussieboykie was suggesting I type > in the CLI window). Thanks for the tip, it will surely come in handy sometimes. But I was really hoping to be able to use the CLI for more extensive and sophisticated non-scripting experiments, without having to set up buttons for them. For example, it would be nice to be able to play with opening dialogs via {dlgstring} and such, and/or set variables via @set, but those all return “Unknown command” when I try them in the CLI.

You can't set variables in the non-script CLI.

Using > is best for trying single line commands. (Note that the up and down cursor keys can be used for command history.)

Using the button editor is best for longer commands. You can run things directly from the editor using F5 or the Run button at the bottom left. (Click the Advanced button first, if it's in single-line mode.)