Vjeran Posted April 4, 2006 Posted April 4, 2006 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
Wim Decorte Posted April 5, 2006 Posted April 5, 2006 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.
Kevin Mortimer Posted July 7, 2006 Posted July 7, 2006 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?
Wim Decorte Posted July 8, 2006 Posted July 8, 2006 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.
Kevin Mortimer Posted July 14, 2006 Posted July 14, 2006 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
Wim Decorte Posted July 15, 2006 Posted July 15, 2006 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).
Recommended Posts
This topic is 6749 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