April 4, 200619 yr Hi, I am using FMP 8 and one VB Script. With this VBS I like to launch FM Script on other FMP file on other computer (standar office LAN net - IP) ... but I have problem with writing right network file path ... VBS is: Set objFM = CreateObject ("FMPRO.Application") objFM.Visible = True Set objFMfiles = objFM.Documents.Open("????c:Proba.fp7","Admin","") objFMfiles.DoFMScript("test") Thx VJ
April 5, 200619 yr AFAIK it can't be done. Used to be in FM 5 or 6 you could do it by just using the name and no path, but they took that away. You'll need to create a small local file that calls the hosted file.
July 7, 200619 yr Does this mean that you can not call on a script that is in a hosted file? If yes do you have to put all the FMP scripts into a local file to be performed?
July 8, 200619 yr No, you can still call a script in a hosted file. You can loop through all open files, looking for the one you want and execute a script. (The difference between a local file and a hosted file is that the file name doesn't include a path if the file is hosted) The catch is that the file needs to be open in FM already, if it is not, you can't open it directly from the host, you need to go through a local file that will call the hosted file.
July 14, 200619 yr Ok...so would the following script be correct for a file called Database.fp7 that is hosted on the network because I tried this but it said the file could not be found.... or do I have do the loop thing you mentioned. Set objFM = CreateObject ("FMPRO.Application") objFM.Visible = True Set objFMfiles = objFM.Documents.Open("Database.fp7","Admin","password") objFMfiles.DoFMScript ("test1") Kind Regards Kev
July 15, 200619 yr Hi Kev, You can't open a hosted file like that. But once it's open, you can run a script in a hosted file. So what you'd need to do is is loop through the collection of open files and see if your file is open. If it is not, open a local file that has a script to open the hosted file (call that script, or configure the file to run it onOpen).
Create an account or sign in to comment