11 Replies Latest reply on Apr 2, 2010 5:46 PM by George99

    Open File using a variable

    George99

      Title

      Open File using a variable

      Post

      I'm back for more guidance please.

       

      I am developing a filemaker database as an index/control for a collection of Filemaker memory games, on which I am using a selection layout with 2 fields, each a pop up selector, the first pop up selects a catagory, the second selects the actual game within that category.

       

      Having selected the game and copied the filename into a variable, how do I feed the variable into the open file script command? The open file option won't let me type in a variable name.

       

      Once I have gotten the selector working, I intend to compile it as the primary file, and all the games into a single kiosk mode.

       

      George Humphries

       

      Novice Filemaker user, using Filemaker 10 advanced, Windows XP

        • 1. Re: Open File using a variable
          Jade

          This may be a way around the problem…

           

          Using  the menu item 'Manage > External Data Sources…" in the File menu, you can define other FileMaker files that will open when you launch your file.  These can be displayed in a separate window by choosing  "Show Window > …"  in the Window menu.  Tables from these external sources can be used in your layouts and scripts.

          • 2. Re: Open File using a variable
            George99

            Thanks for the reply, but I don't think this would work.

             

            Unfortunately I am dealing with about 20-30 games and these are changing as more get added.

             

            George Humphries

            • 3. Re: Open File using a variable
              philmodjunk

              Try using the Open URL option. If you can get the syntax right, it should be able to open the file for you. (I forget the exact format, but perhaps someone can chime in with that?)

              • 4. Re: Open File using a variable
                George99

                Phil,

                 

                This appears to be what I want but I can't get the syntax right.

                 

                My fiirst base with the exe file is in the same directory as the bases I want to open.

                 

                eg D:\FileMakerGames\NewGame.usr

                 

                Do I write something like       "fmp7:D:/FileMakerGames/NewGame"              ?

                 

                George Humphries

                FileMaker novice using Filemaker 10 advanced on windows XP

                • 5. Re: Open File using a variable
                  philmodjunk

                  The easiest way to find out the right format is to launch a web browser, select open from the file menu and browse to the file you want to open, then check out the URL produced.

                   

                  For a windows machine, it'll have a format like this: DriveLetter:\Folder\Folder\Filename.fp7

                   

                  Note: Forward slashes (/) can be used in place of back slashes (\) and they can be easier to use in a calculation.

                  • 6. Re: Open File using a variable
                    Steve Wright

                    Instead of openurl try using Send Event

                     

                    Send the : Open Document / Application

                    Using a calculation, i.e

                     

                    "d:\FileMakerGames\" & $$variable

                     

                    The calculation result should then look like : 

                    D:\FileMakerGames\NewGame.usr

                    • 7. Re: Open File using a variable
                      George99

                      I am attempting to open the compiled bases using the "Send Event" suggested by SWS.

                       

                      I am trying this with my selector base in both FP7 and USR mode.

                       

                      I have reached the point where it no longer complains that it cannot find the file, (so I am getting further on before I come to a halt), but now it just hangs.

                       

                      Am I missing something like having to pass a user id and password?

                       

                      I thought that provided I kept the id's and passwords the same they were transferred over automatically.

                       

                      George Humphries

                      FileMaker novice

                       

                      Filemaker pro 10 advanced using Windows XP

                      • 8. Re: Open File using a variable
                        George99

                        I am attempting to open the compiled bases using the "Send Event" suggested by SWS.

                        As there have been no replies I thought I'd try and clarify a couple of points.

                         

                        I am trying to open a second  kiosk mode file with my selector base in both FP7 and USR mode.

                         

                        I have reached the point where it no longer complains that it cannot find the file, (so I am getting further on before I come to a halt), but now it just hangs.

                         

                        Am I missing something like having to pass a user id and password?

                         

                        I thought that provided I kept the id's and passwords the same they were transferred over automatically.

                         

                        George Humphries

                        FileMaker novice

                         

                        Filemaker pro 10 advanced using Windows XP

                        • 9. Re: Open File using a variable
                          philmodjunk

                          I don't see why that isn't working, but I haven't used Send Event very much.

                           

                          Open URL should also work (Note that both options require the same file path reference.) Have you tried that option. (In either case, make sure you have the right file extension such as .USR specified.)

                          • 10. Re: Open File using a variable
                            WoodApple

                            also...

                            make sure "Bring target application to forground" is checked.

                            • 11. Re: Open File using a variable
                              George99

                              Sorry people especially Phil,

                               

                              I finally got the send event to work :smileyvery-happy:.

                               

                              Still couldn't get the open URL to work it came back ".fp7 could not be opened. Either the host is not available or the file is not available on that host".

                               

                              But the send event problem was mine, I thought I had remmed out a line to close the first database window it was shutting down the first database before opening the second.

                               

                              Once I had deleted the close window command I can now open the second database.

                               

                              George Humphries

                              Very much a Filemaker novice. :smileysad: