3 Replies Latest reply on Oct 16, 2013 8:42 AM by philmodjunk

    little help please

    ryandunne_1

      Title

      little help please

      Post

           ok so after hours of trawling the internet i have come across a plugin which will help me greatly the only problem is i dont know how to implement the custom functions that it creates for instance i have a custom function that creates a text file in a certain folder which i need it to create as part of a script but i dont know where the function goes or what i need to add to it

            

           this is the function

           AppendToFile( filePath ; textToWrite )

           i need it to run after ive done an export script

           i also get specified table not found etc

           as you can probably tell im a new user i need simple steps on how i can get this to work

           cheers in advance

           ryan

        • 1. Re: little help please
          philmodjunk

               You'll need a script step such as:

               Set Variable [$Dummy ; value: AppendtoFile (

               You don't care about the value of $Dummy unless the function is set up to return a code that tells you something useful such as whether or not it successfully created the file. (File permissions can block creating the file and the file path can be invalid.) You'll need to check the documentation provided by the developer to determine if that happens or not.

               You'll need to replace filepath with  the filepath to the location where you want to create this file. There are a number of functions in FileMaker that can help you compute a path, such as a path to the desktop or documents folders and  you can simply specify the full path in quotes here in place of "filepath". Then the second paramter, texttoWrite will need to be replaced by either the text you want in the file in quotes or a reference to a field that contains that text.

               BTW, I could create and save such a text file to disk without needing a plug in to do it. wink

          • 2. Re: little help please
            ryandunne_1

                 hey bud one last question that worked perfect just if you have any ideas on if theres a way to add to the first line of the file instead of the last file with this function,

                 bascily im exporting a .csv with a script and this function is done after the csv is created to add a line of text saying "add WHS" to the csv but it only adds it to the last line of the file and i kinda need it there before the csv starts

                 cheers in advance :)

            • 3. Re: little help please
              philmodjunk

                   You are dealing with a plug in that you have not even named. You'll need to check with your plug in developer and any documentation they have provided to see if there is any way to do that.

                   Chances are that you would need to import that text into a table, put the data that you want to put in a record in the same table. Sort your records to put the added row first and then export. And that assumes facts about the format of your data that may not match what you actually have.