GP SoftwareTwitter
Opus FAQsManualCommandsObjects

How user-defined commands use data in the template (491 Bytes)

<?xml version="1.0" encoding="UTF-8"?>
<usercommand backcol="none" hide_from_menu="no" textcol="none">
	<tip>Generate hash file.</tip>
	<user_label>Generate MD5 hash file.</user_label>
	<function type="normal">
		<instruction>@nodeselect </instruction>
		<instruction>@disablenosel </instruction>
		<instruction>Clipboard COPYNAMES=hash2 </instruction>
		<instruction>Clipboard PASTE AS checksums.md5</instruction>
		<instruction>Clipboard SET &quot;&quot;</instruction>

How do I get the value of the "type" field from the command? And set the file name for "Clipboard PASTE AS" based on this value?

With a Type/K argument, use &Type& to insert the parameter that was given to it.

(Documented here: User-defined commands.)

How to determine the value of the "type" parameter?

Clipboard COPYNAMES=hash2
Clipboard COPYNAMES=hash5


Clipboard COPYNAMES=hash2
Clipboard COPYNAMES=hash5

The value of the "type" argument was not taken.

You would need to use scripting to do conditional branching based on the value of an argument.

In the next update we'll make it so you can do simple tests on the arguments without resorting to a script. The following command will work from 12.16.5:

Clipboard COPYNAMES=hash2
Clipboard COPYNAMES=hash5

Clipboard PASTE=enc:utf16 AS checksums.&TYPE&
return filename

can not get the value of the "type" keyword.

Directory Opus

It works OK here: