3 Replies Latest reply on Feb 18, 2010 1:56 PM by Steve Wright

    Object addressing itself... WHY NOT!?



      Object addressing itself... WHY NOT!?


      It's been my experience with 4 years of Filemaker that theres usually a way to do what you want to do... it's just a matter of figuring out the "trick"...

      but not on this topic... 

      Self addressing an Object so that one can have truly independent... i.e., COHESIVE AND DECOUPLED scripts.  I simply want to pass some form of identification of the object (usually a Button) that invoked the script. I cannot find a way to do it. "Self" is a specialized function which will not work except for very specific places (like Cond formatting) which is extremely confounding to anyone who wants... and understands... the extreme value in clean decoupling.


      Another important question besides why FMI does not build it into FM is WHY nobody is screaming for it besides ME?!


      Rumors are we won't see this in the next version.



        • 1. Re: Object addressing itself... WHY NOT!?
          Steve Wright

          I would generally just pass a script parameter from the button, that way.. the script knows which path to follow so to speak.


          Using Self (so to speak) you would still have to give it an object name, so why not just give it a script parameter or two, its more flexible.

          • 2. Re: Object addressing itself... WHY NOT!?

            "Using Self (so to speak) you would still have to give it an object name, so why not just give it a script parameter or two, its more flexible."


            Good question...

            I currently do it this way as you describe.


            Doing it like this I have to couple the object to the script by inserting the object name and passing it.  Then for each object I either have to spec what's in the parameter or change the script. 



            I have a button with an Object Name (although now that we have script triggers it would be nice to have this for ALL objects).  and then there was a "Me" special function (different from Self which gets at the objects contained value)  "Me" would simply contain the ObjectName of whatever the object was that called the script.  You pass "Me" as a script parameter... which would actually be ideal as the default script parameter.

            Then there's nothing to change across all objects which call this script.  I change the script and it changes the functionality for all.

            Scripts can then be completely independent. This was a relatively simply example.  


            • 3. Re: Object addressing itself... WHY NOT!?
              Steve Wright

              I still dont get is the difference you think it would make :


              Button1 - Object Name : "print report"

              Script : randomscript 

              parameter = ME




              Button1 - [No Object Name] 

              Script : randomscript

              parameter = "print report" 


              I cannot personally see how this would change the way you wrote your script.  The name still has to be entered and referenced somewhere.

              So the parameter is an extra dialog box away, but you don't need a unique object name.  

              You would also have difficulty within the scripts if you needed more than one of the same buttons, i.e on a tabbed layout. 

              i.e Make 3 print buttons on different tabs, and call them all print, you can't !


              Therefore in the script you would have to check for print1, print2, print3 or perhaps patterncount() instead of the same single script parameter.  Overall, extra checking for what ?


              Self on the other hand is completely different, allowing it to use the values contained, therefore its dynamic.  
              Normal objects wont have different values so there is nothing dynamic about them.


              I'm all for new ideas and techniques... but I'm having a hard time grasping this concept, perhaps I am missing something...