I have noticed that Office Scripts created in an Excel Online file are accessible through other Excel Online workbooks' Script Galleries. However in this Microsoft article, it says, "Office Scripts can be shared with other users of an Excel workbook. When you share a script with others in a workbook, the script is attached to the workbook."
That seems to imply that an office script is only available to the workbook where it is created, which would make sense since Office Scripts can otherwise accumulate in the Script Gallery list even though a script created for one workbook is of no use to other workbooks. So unless you then use a good naming convention when you create a script, how do you remember which script was created for which Workbook? But that isn't what I'm seeing. Instead, scripts from different workbooks all display in the Script Gallery no matter which Excel Online file is open.
So my question is whether it is expected behavior for scripts from all workbooks to display in the Script Gallery for any given Excel Online Workbook and if so, is there an easy way that I am obviously missing to tell which script(s) belongs with which workbook? And if this is not expected behavior, has my organization missed a setting? Or what exactly am I doing wrong and how does a person keep these scripts organized??