I am trying to write a script to open a folder where the name of the folder contains halfway in the name a unique identifier.
The folder is a subfolder of a folder which is defined by the user together with the unique identifier in a dialog box.
::result = Dialog(
v list( "Year 20XX", year=Edit Text("17",width(100))),
v list( "Identifier", iden=Edit Text("AA1211",width(100)))
);
The name of all subfolder have the same structure ABC-year-iden-xxxx bbb ddddd FFF.
ABC is fixed. year and iden are selected by the user but x b d F are variables.
I tried to get the filename with pick file but it does not work as last bit of it is variable.
Foldername = Pick file("\\Select folder","C:\Users\20"||::result["year"]||"\"||"ABC-"||::result["year"]||"-"||::result["iden"]||"-*");
Another option is reading the names of the subfolders in the main folder and try to match it but I cannot figure it out with regex.
files = Files In Directory("C:\Users\20"||::result["year"]);
The idea is once I have this folderpathname open a file in this folder with the same name as the subfolder. For that I have the script but I just am looking for a way to identify the subfolder pathway and filename.
Could someone help me out?
Thanks,
SC