Error with Copy CreateFolder when name contains space

G'day,

I have been using a button to move selected files to a folder of the same name with this function

Copy MOVE FILE {filepath$} HERE CREATEFOLDER {file$|noext}

It recently began giving me this error

Clipboard Image

whenever the selected file has a space in the filename. No spaces, no error. The file is not moved and an empty folder is created that is named from the selected file up to the space.

So a_b_c_d.jpg gets moved to a folder named a_b_c_d as expected.

A file named a b_c_d.jpg gives the error and an empty folder named a is created.

I have just now tried Copy HERE CREATEFOLDER= {file$|noext} MOVE from Move to Named Folder - #2 by Steve which gives the same error.

I'm stumped so any help would be appreciated.

Peter.

Quotes should fix it:

Copy MOVE FILE={filepath$} HERE CREATEFOLDER="{file$|noext}"

Admittedly, I am bit surprised that they are needed here.

2 Likes

Thank you sir.

We've fixed this for the next update. {file$|noext} was not adding quotes automatically when needed.

Thanks for reporting it!

Lxp's suggestion is good and will work both with and without the fix. (It won't cause extra quotes to be added after the fix is in place. I've tested that the quotes only get added if they're needed and are missing.)

Using = instead of space between the arguments, as he has done, is also a good idea in case the folder name coincides with another Copy command argument, as it removes that ambiguity.

1 Like

This is now fixed in Directory Opus 12.24

1 Like