Unintentional nested list of POSIX paths in Applescript I am trying to pull a list of files with matching extensions from a directory with subfolders, to use in a terminal script. 

The list items must be separated by vertical bars "|" to run through the command line app, and I need to remove the first item in the list.

on run
    set savedDelimiters to AppleScript's text item delimiters
    set AppleScript's text item delimiters to "|"
    set sourceFolder to choose folder with prompt "Please select directory."
    tell application "System Events"
        set itemList to (POSIX path of every disk item in folders of sourceFolder whose name extension is "VOB" as string)
        log itemList as string
    end tell
    set AppleScript's text item delimiters to savedDelimiters
end run


The problem is the resulting list actually a list within a list. Notice the double curly braces in the reply:

        get POSIX path of every disk item of every folder of alias "Macintosh HD:Users:USERNAME:Desktop:test2:" whose name extension = "VOB"
    --&gt; {{"/Users/USERNAME/Desktop/test2/VIDEO_TS/VIDEO_TS.VOB", "/Users/USERNAME/Desktop/test2/VIDEO_TS/VTS_01_0.VOB", "/Users/USERNAME/Desktop/test2/VIDEO_TS/VTS_01_1.VOB", "/Users/USERNAME/Desktop/test2/VIDEO_TS/VTS_01_2.VOB", "/Users/USERNAME/Desktop/test2/VIDEO_TS/VTS_01_3.VOB", "/Users/USERNAME/Desktop/test2/VIDEO_TS/VTS_01_4.VOB"}}


When I try to work with the list, such as:

log rest of itemList as string


It returns an empty string, since the list created has only one item.

Thinking I must be missing something obvious... thanks for taking a look!
Try:

set sourceFolderPath to POSIX path of (choose folder with prompt "Please select directory.")
if sourceFolderPath ends with "/" then set sourceFolderPath to text 1 thru -2 of sourceFolderPath
set findResultsList to paragraphs of (do shell script "find " &amp; quoted form of sourceFolderPath &amp; " -type f -flags nohidden -iname '*.VOB';")
set AppleScript's text item delimiters to {"|"}
set findResultsText to findResultsList as text
set AppleScript's text item delimiters to {""}
return findResultsText