I am attempting to write a button that finds the CRC32 hash of the selected file, and then appends that hash to the end of the file's name.
For example, I have a text file named "test.txt", which has a CRC value of B919EA13.
I want to make a button that can rename test.txt into "test [B919EA13].txt"
Because DOpus does not (to my knowledge) have a built-in CRC checker, I made a button that uses a command line tool to output the CRC value to a text file, and then calls PowerShell so that all but the CRC value is erased and only the CRC is copied to the clipboard, followed by erasing the generated text file. The problem I'm hoping someone can help with is how to make the button then take the value that is on the clipboard and append it to the end of the filename.
Here's the code I have so far:
<?xml version="1.0"?>
<button backcol="none" display="both" textcol="none">
<label>Add CRC32 to Filename</label>
<tip>Finds the CRC32 value of the selected file, and appends that value to the filename.</tip>
<icon1>X:\icon.png,0</icon1>
<function type="batch">
<instruction>"C:\File Management\crc32.exe" "{filepath$}" -nf > input.txt</instruction>
<instruction>powershell -command "& {get-content input.txt|select-object -first 1}" | clip</instruction>
<instruction>del input.txt</instruction>
<instruction>runmode hide</instruction>
</function>
</button>
Can anyone help find a way to append the clipboard data to the filename with this?
Thanks in advance.