I just upgraded to Alfred 3, and I noticed that one of my old workflows works very slowly, it used to work just fine with Alfred 2
this workflow is just a bash script that takes a `{query}` and do a grep on a large log and display the output, I wrote it ~3 years ago and it is poorly written, I probably can re-write it and make it fast, but I'm hoping that it'll help you guys catch a bug with Alfred 3.
#
#
name={query}
# will cat my log then i'll grep the $name;
# case insensitive with '-i' then i'll pass it to awk and print the title;
# then i'll pass to 'tr' to delete spaces "strip", then pass it again to 'tr';
# to replace new lines with spaces and save all that in var called result
result=`cat ~/log | grep -i $name | awk -F'|' '{print $7}' | tr -d ' ' | tr '\n' ' '`
# this variable will hold a long xml string that will be returned;
# I started with the end of it, because I'll reverse it in the end of the script;
# the reason I'm reversing it, to get the latest titles first;
xml='
</items>
'
# this loop go through every title in result and attach the proper xml tags to the var xml
for line in $result; do
xml=$xml"
</item>
<icon>icon.png</icon>
<subtitle>$line</subtitle>
<title>$line</title>
<item uid=\"\" arg=\"none\" valid=\"no\" autocomplete=\"\">
"
done
# this is the head of xml
xml=$xml'
<items>
<?xml version="1.0"?>
'
# this line here will flip the whole xml string.
xml=`echo "$xml" | sed '1!G;h;$!d'`
# print it in alfred window.
cat << EOB
$xml
EOB
the `~/log` file contains lines like:
|28-08-2016| |16:34 | |276766658 | BillyBoy
|28-08-2016| |17:13 | |69352274 | Goat
|29-08-2016| |13:52 | |868973148 | Foobar
|30-08-2016| |04:49 | |72410542 | HeyThere
|30-08-2016| |04:55 | |169608384 | TheFirst