I am attempting to write my first workflow to assist me with doing a task that I have to perform on a regular basis. The base of this workflow will be to lookup data from a website with a give argument and query, For each argument (type) selects a given URL to apply the query. With it all put together it should open the resulting URL with the information I am looking for. I have written a quick and dirty bash script that takes 2 arguments that works but I would rather do this in alfred's workflow to avoid having to run a terminal command to open a browser window. Below is a sanitized version of my bash script.
#!/bin/bash
# $1 will be what we are looking for
# $2 will be what we input as an argument
MYNAME=`basename $0`
if [ $# -eq 0 ]; then
echo "Usage: $MYNAME type query" 1>&2
exit 2
fi
case "$1" in
abc)
open http://www.myurl.com/blah.aspx?q=$2&v=abc
;;
def)
open http://www.myurl.com/blah.aspx?q=$2&v=def
;;
ghi)
open http://www.myurl.com/blah.aspx?ghi=$2
;;
jkl)
open http://www.myurl.com/blah.aspx?q=$2&v=jkl
;;
mno)
open http://www.myurl.com/blah.aspx?mno=$2
;;
pqr)
open http://www.myurl.com/blah.aspx?$2
;;
stu)
open http://www.myurl.com/blah.aspx?q=$2&v=stu
;;
*)
echo "oops"
;;
esac
any guidance or samples showing how to do this would be awesome
TIA