7 Replies Latest reply on Mar 21, 2011 8:41 AM by philmodjunk

    Filemaker Pro Advanced 11x

    fmnewbie63

      Title

      Filemaker Pro Advanced 11x

      Post

      I have looked throughout the forum regarding how to change the path for a script that is entered in as a local variable $file, how do I see where this is? Here is a code snippet of what the previous had in there. Keep in mind my username. I saw something aobut replace, my fear is this is a live production database, I don't want to screw it up.

    • Set Variable [ $file; Value:GetValue ( SR ; 2 ) ]
    • Thanks in advance

        • 1. Re: Filemaker Pro Advanced 11x
          philmodjunk

          SR is a field defined in your database file. GetValue ( SR ; 2 ) returns the "second value" in a list of values in that field which are separated by returns. This is probably a container field where files are stored by reference. If you define a calculation field, set it to return text and just put SR in as it's calculation, you can see the entire contents of the text in this field--which can be very helpful in debugging issues with container fields where the file is stored by reference.

          If you just want to see the value of $file, you can use Show Custom Dialog [$File] right after the set variable set as a way to pop up a dialog where you can see the file path each time you run the script.

          • 2. Re: Filemaker Pro Advanced 11x
            fmnewbie63

            By changing this script is this going to affect the database in an adverse manner? Or will it not be saved? As you can tell by my lack of intelligent questions I am very new to this.

             

            Thanks again.

            • 3. Re: Filemaker Pro Advanced 11x
              philmodjunk

              Adding Show Custom Dialog will not affect how the script works or fails to work. It will just pop up a dialog that shows you the actual value in this variable so that you can see if it has a valid file path. You might also look up "Creating File Paths" in FileMaker help for more on the type of file paths typically used in FileMaker databases.

              • 4. Re: Filemaker Pro Advanced 11x
                fmnewbie63

                Apologize for the delay in getting back here, I did try the Set Variable [ $file; Value:GetValue ( SR ; 2 ) ] with the show custom dialogue [$file], what I recieved was a message box asking me if I wanted to run the script. I obviously did something wroing.

                • 5. Re: Filemaker Pro Advanced 11x
                  philmodjunk

                  Hard to say what went wrong from here. There's no way that adding show custom dialog would produce such a message unless the text you saw was loaded in $file by the set variable step. And that would mean that the second line of text in SR contained that text. That seems extremely unlikely. You'll need to look over your entire script to see if you can spot where such a dialog might pop up. ("Do you want to run this script" is not a standard dialog, it has to be something specifically designed into a step of the script or something.)

                  You can also examine the contents of the text in the SR container field by defining a calculation field with just SR as it's calculation expression. Set it to return text and put it on your layout next to the SR container field and size it to be at least 3 lines of text in height. With this field, you can inspect the file path stored in the store by reference container field.

                  • 6. Re: Filemaker Pro Advanced 11x
                    fmnewbie63

                    If I export a found set of records to an excel spreadsheet to create a quick report, it is only a copy of the records and not removing data from db right?

                    • 7. Re: Filemaker Pro Advanced 11x
                      philmodjunk

                      Yes

                      (Hint, for some questions, you may get a quicker answer, if you make a back up copy of your database file and then experiment for your self to see what happens.) Wink