I'm trying to make a button which creates a blank Microsoft Word .docx file. I want the filename itself to be from the clipboard. I simply want to be able to copy some text onto the clipboard with Ctrl+C and then hit the button to make the COPIEDTEXT.docx file.
I'm trying this command:
FileType NEW=.docx FROMCLIPBOARD
The problem is that if the copied text has a "." in it, then everything after the last "." is considered the extension. So if I copy this example onto the clipboard:
TEST 12.34.56
and then click the "Create Blank .docx" button, I get:
TEST 12.34.docx
Dopus replaces the .56 which it thinks is an extension with .docx
Then, if instead, I use the command:
FileType NEW=.docx FROMCLIPBOARD=keepext
It no longer adds the .docx onto the end so the above example gives this for the filename:
TEST 12.34.56
Dopus no longer adds the .docx
What I want is simply this:
Copy on to clipboard: TEST 12.34.56
Button creates the file: TEST 12.34.56.docx
So then I tried a BUNCH of things to rename the file after it is made. The problem is using Rename From * TO *.docx renames all the files in the directory.
I thought putting a "Select THIS" would work so I ended up with this script:
FileType NEW=.docx FROMCLIPBOARD=keepext
Select THIS
Rename From * TO *.docx
It still renames everything in the directory. I don't know why the "Select THIS" command isn't working. It seems like this should work but it doesn't.
I'm stumped here. I tried other variations of using the Select and Rename commands with arguements but nothing quite worked.
Maybe another arguement could be added which would keep the whole name from the clipboard and not think it has an extension. Something like:
FileType NEW=.docx FROMCLIPBOARD=noext
There doesn't seem to be an obvious way to accomplish this...