This is actually the only way. Besides Start Using a stack, which inserts the script of the target stack into back, if the script of a button is to be used as a library (or back/front script would be a better way to say it), insert into back or front is the way to do it. Otherwise setting the behavior of something will be persistent, but accomplishes the same thing really. It inserts the script of the object containing the behavior into the message path.
Behaviors are a little different however when referring to me or this me. These return empty when in a front of back script and return the target and behavior of the target respectively when used in a behavior script. Bob S On Dec 29, 2020, at 11:34 AM, Ben Rubinstein via use-livecode <use-livecode@lists.runrev.com<mailto:use-livecode@lists.runrev.com>> wrote: What is the best way to structure a library these days? Currently I've got buttons with a script, and a 'mouseup' handler to 'insert the script of me into back' in my object library. But I don't think that's very modern. What's the right way to do it? Especially if I want to share it? TIA, Ben _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode