I've been trying to tackle a workflow but I keep running into an issue with how Alfred is handling clipboard contents.
The Workflow
The workflow is designed to take content copied from a spreadsheet (two columns, multiple rows) and injest data from both columns into a url in Chrome.
1234 5678
9101112 13141516
The script is designed to inject the items into a url, for example https://mywebsit.com/{field1}/blahblah/{field2}
Here's the script:
CLIPBOARD=$(pbpaste -Prefer txt)
while read LINE ; do
FIELD1=$(echo $LINE | cut -d ' ' -f 1)
FIELD2=$(echo $LINE | cut -d ' ' -f 2)
open -a "/Applications/Google Chrome.app" "https://mywebsite.com/${FIELD1}/blahblahblah/${FIELD2}/"
open -a "/Applications/Google Chrome.app" "https://mywebsite.com/${FIELD1}/beepboop/${FIELD2}"
done < <(echo $query)
I got it working, but it will only open tabs for the first row and won't run through any additional rows. From what I can tell, this seems to be Alfred's fault in how it handles clipboard contents. If I run `pbaste` in Terminal the clipboard contents show up in columns and rows as expected. However if I tell Alfred to send to LOGGER how it's reading clipboard contents, they all show up in a single line.
e.g. When I run pbpaste in Terminal:
1234 5678
9101112 13141516
e.g. How Alfred interprets pbpaste in the script:
1234 5678 9101112 13141516
Is there anything I'm missing here? Is this a known issue with Alfred or is there a different way to approach the problem?