GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Create folder or empty file with name from clipboard

I would like to create two similar scripts to assign into my right click content menu. The first is to create a Folder named by Clipboard contents and the second to create an empty .txt file named by Clipboard if Clipboard contains a string.

The problem is I haven't work with scripts before and I have no idea where to start from!

Any ideas, tips are welcome!

Thank you in advance!

J!

To create a folder from clip, add this:

CreateFolder FROMCLIPBOARDDon't know if you really need a script to check clipboard content before calling this command, I guess DO does some validation on it's own.

To create an empty textfile, maybe start with this, it's also not a script. o)

@nofilenamequoting @runonce FSUtil.exe file createnew "{sourcepath$}\{clip}.txt" 0

To get a general start, I'd look into the manual and the scripting examples at first. Then discover what DOpus.GetClip() and .GetClipFormat() have to offer.

Scripting shouldn't be needed for either thing, unless you have additional requirements.

TBone's already given a good answer for the folder part.

For the file part, the How to Create New/Empty Files FAQ shows ways to create empty files in Opus (no need to use FSUtil.exe). Just add {clip} to one of those commands to make it use the clipboard as the name. There are several different commands there, depending on whether you want the option of typing a new name or editing the file straight away.

(I've renamed the thread, since "Help with script!!!" was not very descriptive.)

1 Like

PS: If you do want/need to use scripting for this, my Paste empty file list script probably does a lot of what you are looking for.

I have just returned and found two answers!!!

Thank you both!!!

Actually you are both right It's too simple to write a script!
My first chance to get involved with scripting is gone!!!

Thanks again!
J!

Not necessarily, I mean these builtin features can be replaced completely by some lines of script.
So there's still alot to learn and try, recreating something existing in another way isn't a bad exercise at all. o)

Thank you tbone!!!

J!