Page 1 of 1

Create folder via the script "File Write Text File"

Posted: 16 Feb 2021, 19:15
by creal
Hello,

When I use the module "File Write Text File" (it's a native script), I connect the "folder" inlet to a custom path name which is "dynamic" (it depends on the date). But I noticed that since the folder does not exist, the script cannot create a text file accordingly.

Is there a way to create the right folder at the right path (defined by the "folder" inlet) before creating the text file, please?

By the way, I take advantage of this thread to ask you if there is a way to enter a simple "space" character in a concat string inlet? (in the meantime I use an underscore character but it's not convenient). More generally, out of curiosity, what about other Unicode characters?

Thanks,

creal.

Re: Create folder via the script "File Write Text File"

Posted: 17 Feb 2021, 10:16
by senso
hello,
you can use the procedure

Code: Select all

procedure CreateDir(dir:String);
to create a directory as referenced in https://www.brainmodular.com/manuals/hh4/en/scripting

The best way to have a 'space' in the concat module is to connect a constant module with the value 32. It's the ascii code for 'space'.
senso

Re: Create folder via the script "File Write Text File"

Posted: 18 Feb 2021, 16:14
by creal
Hello,

thank you very much.

I tested some things with this procedure. For the moment, it didn't find how to add it to the current code. But I don't give up.

Excellent for the ASCII characters. It works like a charm.

creal.