How to debug my Script Library

But it’s not going to work inside handlers. Better to use something like this:

property MyLib : document "MyLibrary.scpt"
--use MyLib : script "MyLibrary"

set padded_name to MyLib's lpad("Doekman", 10, "_")

Learned something new again!
Either add the line global MyLib or your property-solution. Thanks!

I still can’t fully get my head around AppleScript’s scoping rules…

I just wanted to bump this great solution to the question asked in this topic.

This allows you to open your script library file in another SD6 tab/window/document, and use it for debugging as if the handlers were in your main script file.

Note: The document name you use has to include, or exclude, the file extension according to how you have your system set.
Just check the name displayed at the top of the window for that document to confirm.

@doekman, you may want to check the “Solved” checkbox at the bottom of Shane’s post to indicate it as having solved your question (if you believe it does so.).

###Solution by Shane