January 5, 200719 yr I'm trying to make an update system for a set of runtimed files we use at work. I've made a Web Viewer download a text file from my server, parse it and see which files and been updated, the next stage of my plan was to download the files, close the open ones and replace them with the downloaded versions. But I got stuck with the downloading. I've tried using an internetexplorer object from VBScript, but had no luck. Just wondering if anyone has done anything similar or has any ideas/tips on how I could do this. Thanks
January 5, 200719 yr Can you post the code that you've been using? I can see how you can script IE to download the files for you but what do you expect to do from there?
January 6, 200719 yr Author The code I've been trying and keep chaning about is: dim ie set ie = createobject("internetexplorer.application") ie.visible=false ie.navigate2("http://mwfit.net/test/updates.txt") do while ie.busy=true wscript.sleep 60 loop call ie.execwb("saveas",2,"c:updates.txt") ie.quit But I get an error on the saveas line, on the internet I keep seeing different ways of having that line, but so far none have worked. My plan is once the file is uploaded, to run a FM Script to close the other file, replace it with the downloaded one sing VBScript and then open the new file using another FM Script. So then they would be using the updated files.
January 6, 200719 yr do you have an FTP server? Then you could use FTP to download the files instead of relying on HTTP. I've never used IE's support for OLE calls but it seems to me that your "saveas" should really be IDM_SAVEAS except that VBscript doesn't understand named constants so you'd need to find the numerical equivalent of IDM_SAVEAS. But that's just a guess on my part. Let us know how it goes and if we can help you further along.
January 6, 200719 yr Author I changed "saveas" to 71 which is IDM_SAVEAS, but then I get a new error: Error: Trying to revoke a drop target that has not been registered We do have a ftp server, how can I use VBScript to connect to that? Using the built in Windows FTP fucntions? Thanks for help btw :
January 6, 200719 yr yes, using the command line FTP client would be the way to go I think. Probably faster download too.
January 11, 200719 yr Author I have a vbcript which can download files fro my ftp server now, as well as a filemaker script which parses a text file downloaded in the webviewer. Is there anyway I can inform filemaker when the ftp download is complete? So I can then close the running filemaker file and replace it with the downloaded copy.
January 12, 200719 yr You're a little handicapped in this since you're using runtimes. With regular FM Pro you can have your VBscript call a FileMaker script (through FileMaker's ActiveX implementation), but that's not available in runtimes. Not sure what the best way to do it is... When the FTP command is done in your VBscript, just use the shell to "AppActivate" your runtime and use "SendKeys" to ALT-F4 (close) it?
January 22, 200718 yr Author I've decidd to now code a Plugin to do the downloads, which returns data back into FileMaker. Once I've finished it and added lots of error checks I may put up for download somewhere in case other people want to use it.
Create an account or sign in to comment