July 13, 200520 yr Hi, I am trying to create a folder in windows based on a field name. I have a unique ID number for every record, and I am trying to create a folder that is named the ID number. I have my script set up, but everytime filemaker opens a MS-DOS CMD window, the rest of my script doesn't get typed out to create the folder. Here is my script: Enter Browse Mode [] Set Field [patientlist::Global; "cmd c/ md c:testfolder" Set Event["aevt";"odoc";Patientlist::Global The MS-DOS window opens, but the "md c:testfolder" never appears in the ms-dos window. If I manually type it into the ms-dos window, it works fine. Ultimately, I would like to replace the testfolder with a field name (unique identifier), so every record will have a folder with the same name as the unique identifier, then I can access that folder by having filemaker open the folder using the field name. However, I can't figure out how to have filemaker replace the "testfolder" with a field name. I keep getting a quotation error in scriptmaker. Any help would be greatly appreciated!!! -Steve
July 13, 200520 yr Hi Steve, First off I see a syntax issue: it should be "CMD /C" not "CMD C/" Try something like this: Set Field [patientlist::Global; "cmd /c md c:" & Tablename::IdNumber That should do it. I have done this exact thing so if you have more trouble just write back and I'll help if I can.
July 13, 200520 yr Steve, You also mentioned having FM open the folder once its been created. Here is how you might do that: Send Event ["aevt"; "odoc"; "cmd /c If Exist "servernamefolder1folder2folder3" & table::field & "" (explorer.exe "servernamefolder1folder2folder3" & table::field & "") else (explorer.exe "servernamefolder1folder2folder3")"] If you attach that Send Event to a button it will open the Windows Explorer in the folder identified in the ID field. If there is no folder it will open in the parent folder. If you don't need the latter part you can just wack the IF and ELSE stuff. The syntax gets tricky because the backslash is an escape character.
July 13, 200520 yr Author Hi Ted, you've helped me out before, I thank you for your generosity. I'm having a problem with the script info that you gave me when I enter "cmd md c:"Patient List::id number into the calculated field value for assignment to global, I get an error, THE TEXT CONSTANT DOES NOT END WITH A QOUTOATION MARK. I'll play around with it, but it doesn't like the quotes I guess..... Thanks again -Steve
July 13, 200520 yr Author OK, I solved the backslash and quotes problem, I just added another backslash and it works fine, but for some reason, I am getting the ms-dos windows opening, but the event that I am sending isnt appearing on the scrren... When I manually type it its fine, but I cant get filemaker to "send" the info to the MS-D0s screen... Any advice? -Steve
July 14, 200520 yr Author FYI. When I go to the run command in windows XP, if I type cmd md c:11, the wondows opens, but nothing again is entered into the window. Is it possible that filemaker is roing its job, but windows isn't accepting the extra commands, only the cmd command??? Thanks -Steve
July 14, 200520 yr Author Solved it! Turns out the /c executes the commands that follows, then closes the windows. Taking away the /c stops the following commands from being executed. A /k will cause the window to remainl, and it will execute the commands. I was removing the /c thinking that it would still execute the commands, but leave the window open! thanks again Ted! -Steve
Create an account or sign in to comment