Quote from
Gaev on June 1, 2020, 8:23 pm
@sghoshnbu
This variable holds the complete path of the folder selected. E.g D:\democontent\vnw\.
When I invoke FolderBox, I do NOT get the final \ ... e.g. c:\gk\Neo5\gkLab
Now I need the folder name only(vnw) and no path as I want to create a sub-folder under the [savedFolder] variable with the folder name vnw. Once I fired the command
CreateFolder "[savedfolder]\[savedFolder] it is complaining as the variable is having value "D:\democontent\vnw\.D:\democontent\vnw\."Please suggest me how to retrieve the current folder name only without path value
Try this code ...
FolderBox "Select Folder" "[savedFolder]"
ExtractFilePath "[savedFolder]" "[Path]"
StrReplace "[savedFolder]" "[Path]" "" "[withoutPath]" ""
SetVar "[newFolder]" "[savedFolder]\[withoutPath]"
AlertBox "Your selection" "[savedFolder] ... [Path] ... [withoutPath][#13][#10][newFolder]"
.CreateFolder "[newFolder]"
... once you are satisfied with the value of [newFolder], uncomment the last command.
@sghoshnbu
This variable holds the complete path of the folder selected. E.g D:\democontent\vnw\.
When I invoke FolderBox, I do NOT get the final \ ... e.g. c:\gk\Neo5\gkLab
Now I need the folder name only(vnw) and no path as I want to create a sub-folder under the [savedFolder] variable with the folder name vnw. Once I fired the command
CreateFolder "[savedfolder]\[savedFolder] it is complaining as the variable is having value "D:\democontent\vnw\.D:\democontent\vnw\."Please suggest me how to retrieve the current folder name only without path value
Try this code ...
FolderBox "Select Folder" "[savedFolder]"
ExtractFilePath "[savedFolder]" "[Path]"
StrReplace "[savedFolder]" "[Path]" "" "[withoutPath]" ""
SetVar "[newFolder]" "[savedFolder]\[withoutPath]"
AlertBox "Your selection" "[savedFolder] ... [Path] ... [withoutPath][#13][#10][newFolder]"
.CreateFolder "[newFolder]"
... once you are satisfied with the value of [newFolder], uncomment the last command.
proforma.guyot has reacted to this post.