I have a problem, I'm trying to save workbooks and excel files using the "save -i" function. This works no problem if the destination folder already exists but if it does not, it will not automatically create the folder. (When exporting graphs, this is done automatically)
Is there a way to create new folders from labtalk? And if not is there any other way I could automate the process?
Unfortunately there is no LabTalk to create a folder in the OS. You can check if a path exists with the exist function as in:
if( !exist("D:\Temp\Example3",5) ) { ty Sorry. I don't exist!; }
There's a CreateDirectory Origin C function, but the programmers ( in their infinite wisdom no doubt ) decided to type that function as a Boolean ( I hate when they do that ) which means you would have to create a wrapper function to make it callable from LabTalk.
Time to set the Way Back Machine to the early days of computing ...
Run this script: type -gb %YMakeDirectory.BAT; type "md %1"; type -ge;
That creates a file named "MakeDirectory.BAT" in your User Files Folder.
Now we can use the exist function to test if our folder structure exists and if not, use this file to create folders for us: