What are the advantages and or disadvantages of calling Handlers from a Library Script with “use Statements“ vs. the “Load Script” command?
I have added a “script logger” to the beginning of every one of my scripts, which basically writes to file…. The script name and the time and date it was last run.

All of the commands for the logging, reside in a script object located in a separate file “Jimz_Handlerz.scptd” used as a script library which is located in my script libraries folder.



This following code, which is located in the file “Jimz_Handlerz.scptd”, is the script object which handles the logging

script scriptRunLog2
    try
        writeToFile()
    end try

    on writeToFile()
        set currentDate to (current date) as string
        -- The "." At The Beginning Of The Filename In The Next Line
        -- Makes That File A "Hidden" File
        set theFile to (path to desktop as text) &amp; ".script_run_log.txt" 
        set theFile to POSIX path of theFile
        set myName to name of (info for (path to me))
        set theText to myName &amp; " was last run on " &amp; currentDate
        try
            set writeToFile to open for access theFile with write permission
            write theText &amp; linefeed to writeToFile as text starting at eof
            close access theFile
        on error errMsg number errNum
            close access theFile
            set writeToFile to open for access theFile with write permission
            write theText &amp; linefeed to writeToFile starting at eof
            close access theFile
        end try
    end writeToFile
end script




There are two ways of which I can run the commands within that script object, from any other script file.

OPTION 1  Using the "load script" option inserted at the top of any other script file

property theLibrary : (path to home folder as text) &amp; "Library:Script Libraries:Jimz_Handlerz.scptd"
property jimzHandlerz : load script alias theLibrary
run jimzHandlerz's scriptRunLog2




OPTION 2  Using the "use" option inserted at the top of any other script file.  Because "Jimz_Handlerz.scptd" is located in my script libraries folder, I do not need to define its location

use jimzHandlerz : script "Jimz_Handlerz.scptd"
run jimzHandlerz's scriptRunLog2




In regards to the question in my original post… 

if I use option 1, the script logger will log which script I ran along with the time and date.

However, if I use option 2,  the script logger will log "Jimz_Handlerz.scptd" as the script running the code.

In short, in this scenario, it would be best to use option 1