Hi all, is it possible to create a dynamic script filter, in the sense that the list of options is created on the basis of the contents of a directory? I currently have this code, which seems to work in the terminal, but it doesn't produce the list that I would like:
for f in mydirectory/*;
do
x=$(basename "$f")
x1="${x%.*}"
x12=$(echo $x | sed 's/_.*//')
cat << EOB
{"items": [
{
"uid": "$x1",
"type": "file",
"title": "$x1",
"subtitle": "",
"arg": "mydirectory/$x1",
"autocomplete": "$x1",
"icon": {
"path": "colour_$x12.png"
}
},
]}
EOB
done