Passing a Python list of strings to Applescript? -


i have python script evaluates directories on hard-drive criteria matching files. returns list of strings, containing file names.
in applescript, call python script do shell script "path-to-script.py".
if print list inside python script , run script applescript, appears single string (i.e. "['string1', 'string2', ..., 'stringx']") in results dialog of script editor app.

does know, how pass python list identical applescript list?

thanks.

the straightforward way have python script print list items on separate lines:

print("\n".join(list_of_files)) 

and in applescript, break lines list:

set applescript's text item delimiters return set list_of_files text items of (do shell script "path-to-script.py") 

Comments