4 Replies Latest reply on Oct 22, 2013 10:29 AM by shae1725

    Can you Link a Script to a table::field

    shae1725

      Title

      Can you Link a Script to a table::field

      Post

           I have a table populated with  " templates " each template has its own script

           Is it possible to link the field  Template::ID to a particular  script

           that way i can write a script to read template::ID and trigger the related script

        • 1. Re: Can you Link a Script to a table::field
          philmodjunk

               If [Template::ID = 1 ]
                  Perform Script [Script for Template 1 here]
               Else IF [Template::ID = 2 ]
                  Perform Script [Script for Template 2 here]

               but in many cases, there are less cumbersome alternatives via script parameters and such, but those options require a more detailed description of how each of these "Record specific" scripts differ from each other.

          • 2. Re: Can you Link a Script to a table::field
            shae1725

                 Each Record in the Table::Template  contain the parameters to be called by the associated script. and all the scripts are written individually for each Template.

                 ie Record 1 = Script 0001 . Record 2 =Script 0002,  and so on

                 This is the only way I can proceed as the scripts are calling GraphicsMagick functions to draw  vector shapes.

                  

                 On the sample you provided would I have to add to the calculation each time I create a new record for newTemplate?

                  

            • 3. Re: Can you Link a Script to a table::field
              philmodjunk

                   Yes, but it may not be your only alternative.

                   You might be able to set up a script that loops through a list of function calls for GraphicsMagick and calls the specified function, passing the specified data to it.

                   Such an "interpreter" script could then service all your template records simply by passing the script a different list.

              • 4. Re: Can you Link a Script to a table::field
                shae1725

                     Yes I looked at what you decribe as an "interpreter" script.

                     The only problem is this would scripting at a level far above my abilities! though It wont stop me trying at some point.

                     I think your first suggestion is the way to go at the moment.

                     It would be a great feature if scripts could be "named" just like objects and be able to be called from a table::ID

                     Many Thanks again