Adam Dempsey Posted January 5, 2007 Posted January 5, 2007 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
Wim Decorte Posted January 5, 2007 Posted January 5, 2007 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?
Adam Dempsey Posted January 6, 2007 Author Posted January 6, 2007 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.
Wim Decorte Posted January 6, 2007 Posted January 6, 2007 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.
Adam Dempsey Posted January 6, 2007 Author Posted January 6, 2007 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 :
Wim Decorte Posted January 6, 2007 Posted January 6, 2007 yes, using the command line FTP client would be the way to go I think. Probably faster download too.
Adam Dempsey Posted January 11, 2007 Author Posted January 11, 2007 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.
Wim Decorte Posted January 12, 2007 Posted January 12, 2007 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?
Adam Dempsey Posted January 22, 2007 Author Posted January 22, 2007 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.
Recommended Posts
This topic is 6558 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now