Create A Delimited List of Tags

Description

Some programs that utilize tagging require an AppleScript to transform a text list of tags into a list value. This subroutine will allow you to route the text returned from a dialog box into a list like this -- and this code also allows you to choose the "delimiters" between tag items (for example -- commas, colons, etc.)

The Code

--TAG SELECTION SUBROUTINE
on Tag_List(userInput, theDelims)
    set oldDelims to AppleScript's text item delimiters
    set theList to {userInput}
    repeat with aDelim in theDelims
        set AppleScript's text item delimiters to aDelim
        set newList to {}
        repeat with anItem in theList
            set newList to newList & text items of anItem
        end repeat
        set theList to newList
    end repeat
    return theList
    set AppleScript's text item delimiters to oldDelims
end Tag_List