Jump to content
Server Maintenance This Week. ×

File path


This topic is 6495 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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("?:D???c:Proba.fp7","Admin","")

objFMfiles.DoFMScript("test")

Thx

VJ

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 months later...

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

This topic is 6495 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.