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.
Thanx for replying...
i am also using export records.. but in this i dont know how to store objects(VBscripts) value in database.
Can you give a specific example?
What I did was to define several fields in the table:
The bare minimum where:
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.)
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.
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.TitlestrFilePath = objFile.self.Pathits 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..
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.
yeah But whats next...i mean..after select the folder then what to do..how to save this path in filemaker..??
Can you please write down the step..
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.
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...
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.