Hi, to continue with Juris's assessment, a script runs within a context, for example as the result of an event from an MBO or perhaps a cron or integration. When the context is created, there will be a reference to the event trigger which is particularly useful if the event was an MBO because there will be a reference to that MBO (and all the related MBOs) within the new script object.
The error shown suggests there isn't a reference to the object your looking at, so the question to answer is what objects are in the current context. There are several tricks I use to understand what is available within the context. I have a development snippet I use that simply logs (rather than prints) the current MBO and the type of trigger that created the current script context. I also use 'dir' to expose information about the methods available within the current invocation. Note that the difference between print and log is that print statements execute at the end of the script execution, whereas log statements execute immediately (essentially).
One more thing to beware of init scripts. Because of the timing in the creation of the MBO in an init script, some pieces of the MBO that might appear in the fully constructed MBO might not be built when the init executes. There is also the possibility that a script may fail here without any overt indication in the logs (other than the script does proceed past a certain point)
------------------------------
keith simmons
------------------------------