GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Renaming File in Save As


I have a question on file saving and I am not sure whether it belongs to Directory Opus or not directly but as it is related to saving of files, I am asking it in this forum in case Directory Opus can help somewhere as I read somewhere that Directory Opus can rename files on the go.

Lots of programs open file Save As dialog to save files. e.g. Downloads of files using web browser, saving of file in Microsoft Word using Save As and so on. All these Save As differs slightly based on the program which opens them but all have few common features of allowing to select the folders where file needs to be saved (e.g. every time last saved folder can open or a predefined folder opens etc.), filename where we can use the default shown or modify the name if necessary etc.

It is in the filename save I want to know if Directory Opus can help.

e.g. Many a times the default file name which is shown by the program (e.g. Microsoft Word shows the first line or title as name and truncates it when it reaches some special characters like - in the title, browser shows title of window as file name etc. and shows everything including comma, semicolon, percent sign, apostrophe in name and some of them are not even valid characters allowed in file name and many other valid characters also like comma I personally prefer to avoid.

Is there any way Directory Opus integration with Windows allows to replace some predefined characters like % , : _ ' etc shown in the default name to be replaced by spaces or some other character (e.g. % can be replaced with pc, : can be replaced with -, comma can be replaced with space etc.)

Thanking in advance,


You could copy the suggested filename into the clipboard, use Opus to perform all needed replacements and paste the name back.

function OnClick(clickData) {

    if (DOpus.GetClipFormat() != 'text') return;

    var tmp = DOpus.GetClip();
    tmp = tmp.replace(/%/gm, 'pc');
    tmp = tmp.replace(/:/gm, '-');
    tmp = tmp.replace(/,/gm, ' ');
    tmp = tmp.replace(/(_|\')/gm, ' ');

Clean Generic.dcf (897 Bytes)

1 Like

Thanks a lot. This works like a charm.