When are codes resolved?

I'm using the following JScript coding and wonder when DO will resolve those embedded codes like {d!} or {Rs...}

var dlg = "{d!}{Rs|Output File name?\n(.mp4 will be appended)|merged}.mp4";
DOpus.Output(dlg);

The output is

{d!}{Rs|Output File name?
(.mp4 will be appended)|merged}.mp4

I expected to get a dialog that prompts me for the some input that is written to the console for debugging purposes.

Those codes work in commands. They don't work in scripts (except when used as part of a string that's passed to Command.RunCommand).

Instead, use the scripting objects which give you access to the same things.

Would you mind giving me a short example, Leo?

Additional question, 'cause I found nothing helpful in the online help, I was just digging around a few minutes ago: Which purpose are the following codes "{d!}{Rs...? I found them in the forum a few days ago and they properly fit my needs :smiley:

Of course I found {d!} and {Rs} but not in combination of both.
{Rs} shows a dialog for string input and according to the help, {d!} gives me

Destination path, long filenames, not required.

That's the reason I've initially asked my question, because I would like to see the output prior the run command.

The default script you get when creating a new button and setting it to script mode has some examples.

The Buttons & Scripts area of the forum has many more examples.

They’re all in the Reference section of the manual, as well as the drop-down menus in the button editor. I would have to look them up myself as I don't use the short versions of the codes; they’re too hard to read and remember compared to the nicer long versions.

Combining the codes in that way just inserts one after the other. Nothing magic going on there.

1 Like

Unfortunately not when the script type is JScript or VBScript, but that's a different story. Maybe worth adding those menus there, too? At least those that make sense for those script types?

After looking more thoroughly, I now understand what's going on: {d!} first inserts the destination path into the final string and {Rs} delivers a user entered string. Both strings are concatenated to the final result string. Understood :laughing:

You very rarely use any of those codes in scripts. The script can build up the command itself, and get the same information more directly, as well as request information via dialogs which it can do more easily, and with more control, via the Dialog object than things like {dlgstring}. Using the codes rarely makes sense from a script.

OK, just persuaded :+1: