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.
"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."
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.
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...