11 Replies Latest reply on Aug 8, 2013 8:07 AM by philmodjunk

    how to store vbscript's objects in db

    SamThomas

      Title

      how to store vbscript's objects in db

      Post

           Hi..

           I m trying to learn vbscript ..and execute in fm..

           in this i dont know ..how to use objects value ..mean set object value's in fm's database ..

           e.g ..objPath = objFolderItem.Path..

           in this what should i have to do to store the objPath in ..Path field..???

        • 1. Re: how to store vbscript's objects in db
          philmodjunk

               VBScript is normally compused in a text file and then executed.

               Are you trying to dynamically compose the lines of VBScript from within FileMaker and then execute it?

               I"ve done that by using a table of text fields and then used Export Records to export and then open the file. The "open" event causes Windows to execute the script.

               I can also use the same exact table, but with a different file extension when exporting, to create and execute a file of Batch commands.

          • 2. Re: how to store vbscript's objects in db
            SamThomas

                 Thanx for replying...

                 i am also using export records.. but in this i dont know how to store objects(VBscripts) value in database.

                  

            • 3. Re: how to store vbscript's objects in db
              philmodjunk

                   Can you give a specific example?

                   What I did was to define several fields in the table:

                   The bare minimum where:

                   Command
                   Parameters
                   Command Line

                   Command LIne was defined as: Command & " " & Parameters.

                   That was all I needed, but my batch files and scripts were very simple.

                   A more sophisticated example could be set up where Command LIne uses the substitute function to replace Placeholder text in Command with data from your database. (And take a look at the Evaluate function as  a way to take an expression entered as text and evaluate it as though it were a calculation entered into a calculation field's Specify Calculation dialog.)

              • 4. Re: how to store vbscript's objects in db
                philmodjunk

                     Oh Yes, and I used a script to update the Parameters field just before exporting the records to put data from my database into the lines of the VBScript or Command Lines.

                • 5. Re: how to store vbscript's objects in db
                  SamThomas

                       Hi Phil Thanks for replying......i want to open folder dialogbox ...

                       For that i used VBscript..i save the VBScript in particular folder ...insted of exporting script...

                       and then using send event i called the script..

                       This is VBScript...

                  Set objShell = CreateObject("Shell.Application")
                  Set objFile = objShell.BrowseForFolder(0, "Choose a folder:", &H4000,)
                  strFileName = objFile.Title
                  strFilePath = objFile.self.Path
                        
                  its shows below dialogbox

                       now i want to do is ..i select ..java folder ......path of this folder is saved in strFilePath Object..

                       So how to pass this value to the filemaker..database...

                       for this case import is not in option because ..theree are more then 10000 record..and this dialogbox is available for every record..

                       please help....

                       thanks...

                  • 6. Re: how to store vbscript's objects in db
                    philmodjunk

                         Well, that's why I generate the VBScript from records in my table. That way I can then export the script with data included from the database before exporting the file. With the open on export option selected, the exported script--which I export to the temporary folder, then executes automatically.

                    • 7. Re: how to store vbscript's objects in db
                      SamThomas

                           yeah But whats next...i mean..after select the folder then what to do..how to save this path in filemaker..??

                      • 8. Re: how to store vbscript's objects in db
                        SamThomas

                             Can you please write down the step..

                             thanks..

                        • 9. Re: how to store vbscript's objects in db
                          philmodjunk

                               Sorry, I should have read your previous posts more carefully. I've been looking at this from the point of view of getting data from FileMaker into the VBScript steps, not from getting data from the executed VBScript back into FileMaker.

                               There isn't a simple way to do that as far as I know. You'd need to output that file path as a text file and then have FileMaker Import the text file.

                               I will note that there are plug ins that allow you to interact with folders directly in FileMaker without a system script--that may prove to be a better option.

                               I've also been able to "sort of" select folders without any plug in or system script. The catch to it is that you really select a file inside that folder and then extract the folder path from the resulting file path to the selected file--which is not ideal and difinitely has limitations to when it can be used.

                          • 10. Re: how to store vbscript's objects in db
                            SamThomas

                                 plug ins is good option ..But in my case prob is ...if i used plugins for select folder ...dialogbox.....it only show folders ...i want to show files also ... ..is there any free plugins or any way to do this..........ri8 nw i used vbscript to perform this..but using this..its become complex...

                            • 11. Re: how to store vbscript's objects in db
                              philmodjunk

                                   There are a number of plug ins that you can research. Mooplug is free and as far as I know, you can use it to list folder contents.

                                   Ps. FileMaker can be set up to list the contents of any folder located inside the documents folder.