In an AppleScript, how do I call/reuse a subroutine from another AppleScript?
Save this as text.scpt in Script Libraries folder

on removeText(searchText, sourceText)
    set {TID, text item delimiters} to {text item delimiters, searchText}
    set sourceText to text items of sourceText
    set text item delimiters of AppleScript to ""
    set sourceText to sourceText as text
    set text item delimiters to TID
    return sourceText
end removeText


Call it like this in another script:

set theSentence to "I love Windows and I will always love Windows."
tell script "text" to set theSentence to removeText("Windows", theSentence)