I have a Python script that evaluates certain directories on my hard-drive for criteria matching files. It returns a list of strings, containing the file names.
In Applescript, I call the Python script with
do shell script "path-to-script.py"
The most straightforward way to do this is to have the Python script print the list items on separate lines:
And in AppleScript, break those lines up into a list:
set AppleScript's text item delimiters to return set list_of_files to text items of (do shell script "path-to-script.py")