8 Replies Latest reply on Mar 27, 2013 5:45 AM by JimMac

    'open file' script step



      'open file' script step


           Is it possible to pass a parameter to an 'open file' script step?

           I have a shared database solution that is being deployed to different customers, each with their own local network. The solution database is not shared across networks. Each local network is its own world.

           I want to place an icon on the client computer desktops that the user can click to launch their instance of the shared solution remotely without having to do anything but click the icon.

           The file must be 'specified' in the 'Open File' script step if the user just clicks the icon to launch the solution.

           I could program and maintain the launching program for each of my customers but I'd rather have a solution that can be 'trained' on it's first use on the client computer by executing the 'open file' script without the file being specified, capturing the file path, and then on subsequent uses of the launching program passing that path to the 'open file' script step as the 'specified file'.

           It's not acceptable to have the customer modify the script once the solution is deployed to their network. They don't know - shouldn't need to know - how to 'do things' in FileMaker. The rest of the solution is entirely scripted through user interface.

           If this makes sense, how would I - or can I - script this to 'train' the client computer's launching file to open remotely the shared solution?


        • 1. Re: 'open file' script step

               For a local install on Windows, couldn't you put the path to the Filemaker database in the PATH environment variable during the installation (of the database)? Then in a shortcut you would only need the shortcut to be something like:


               I tested this on my Windows Vista 32-bit workstation and it works OK.

               if the database is on another networked location then you might need something a different command line (see the Filemaker knowledge base)

          • 2. Re: 'open file' script step

                 The database is 'shared' from another network location (FM Network sharing turned on). And I am not present for installation of my software (downloaded and installed from the internet). Since the local network IP addresses vary with each installation I can't pre-program the file reference for the remote access (rather I don't want to have to 'customize' and maintain the installation for each customer).

                 For script steps like 'import records', you can define a file reference in a 'set variable' script step and then use that reference in the 'import' step.

                 I'd like to be able to do the equivalent for the 'open file' script step, but don't think that's supported in FMP12. Is there any other way to achieve the same result?


            • 3. Re: 'open file' script step

                   Variables cannot be used with Open File and the type of file paths we put in $Path variables are direct references to files--not a method you want to use to open files hosted over the network anyway.

                   I could be wrong as I haven't done this myself, but I think Steve Tilbury is suggesting that you configure a software installer to install the needed short cut as I think some of them can be programmed to do this kind of thing automatically.

              • 4. Re: 'open file' script step

                     That's what I thought.

                     If  I understand Steve's suggestion, the shortcut would directly open the shared file - and not open it over the FM File Sharing Network. I remember reading in the knowledge database that this is not recommended since it could corrupt the files opened on the host - (notes in http://help.filemaker.com/app/answers/detail/a_id/9827 ). If not, I need to better understand Steve's suggestion.

                     My installer currently installs an FMP file with a shortcut on the desktop to it that simply executes a File Open script step. The user has to be trained to find their database by clicking the 'Remote' button, selecingt the 'local host' and double clicking the only displayed file (I doubt that they would have other FMP shared files to choose from given the computer savvy - or lack of - of most of my users). Not that much to expect, but they don't want to be 'bothered' in getting to their database.

                     If I know the IP parameters for my customer's local network, I could 'specify' the file in the script and then when they click on the shortcut the remote file would open automatically. That's what they want - touch and go. It's unrealistic to give them instructions how to modify the script themselves to 'specify' the file, and I don't really want to maintain separate versions of the launch file (and also separate installers) for each customer. I guess either I'm lazy or just stubborn,

                     Still hoping for a miracle solution! It would be great if they only had to 'find' their database once and the script would then know where to look for it from then on.


                • 5. Re: 'open file' script step

                       You might be able to write a script in VBScript or Powershell to discover the IP address and then write the shortcut to the desktop.

                  • 6. Re: 'open file' script step

                         That sounds like it could work. I'll just have to find somebody with those skills to write the script!

                         Thanks for sticking with me on this!

                    • 7. Re: 'open file' script step

                           After further reflection, it still sounds like the remote file will be opened directly - outside the FM Network. From what I've read, that creates risk to the integrity of the database - especially if the file is already open on the 'host'.

                           Am I missing something?

                      • 8. Re: 'open file' script step

                             I have tried to accomplish the same, but have discoverd "touch and go" is less practical that you might think.

                             Base Requirements...

                             INTERNET: External IP addresses must be FIXED.   Extrernal Hacking Potential is made easier.  What if there or more than one IP?

                             INTRANET: Local IP addresses must be FIIXED and may include both WiFi and Ethernet ports. Which one does the USER have? What if the USER switches from time to time.

                             The Favorite host name would have to be Defaulted to the Local IP address.

                             Local Admin would have to Set Up everytime there is a Router Change.

                             Oooppsss ....

                             They still have to Touch at least twice in most Served DB's.  Once to open, Once to log insurprise


                        Think and Go! yes  

                             But I understand the problem is most people don't want to Thinkwink