silberistgold Posted June 20, 2013 Posted June 20, 2013 Hey Guys, I was playing around with the Script Filter XML a bit and now I have the following script, which does not work, but I cant tell why: cat << EOB echo "<?xml version='1.0'?>" echo "<items>" for line in $(gpg --list-keys | grep -E -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b") do echo "<item uid='$line' arg='$line'>" echo "<title>$line</title>" echo "</item>" done echo "</items>" EOB Strange thing is: When I execute the script in my bash an copy the output as xml in the ScriptFilter, everything works fine. I suspect escaping to be the problem, but can not get it to work... Any ideas? daehn 1
Andrew Posted June 20, 2013 Posted June 20, 2013 Hey Guys, I was playing around with the Script Filter XML a bit and now I have the following script, which does not work, but I cant tell why: cat << EOB echo "<?xml version='1.0'?>" echo "<items>" for line in $(gpg --list-keys | grep -E -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b") do echo "<item uid='$line' arg='$line'>" echo "<title>$line</title>" echo "</item>" done echo "</items>" EOB Strange thing is: When I execute the script in my bash an copy the output as xml in the ScriptFilter, everything works fine. I suspect escaping to be the problem, but can not get it to work... Any ideas? Would you mind popping your Powerpack email address into your forum profile (only viewable by me and Vero) before asking for Powerpack support, cheers! Andrew
jdfwarrior Posted June 21, 2013 Posted June 21, 2013 Sorry, updated my profile... Have you put this in a regular script yet to confirm that it is producing properly formatted XML?
silberistgold Posted June 23, 2013 Author Posted June 23, 2013 Hi Andrew, yep I have. If I put the Output from my regular .sh script directly into the Script Filter Window (the static XML) it works fine. Output looks like this... <?xml version='1.0'?> <items> <item uid='blablabla' arg='blablabla'> <title>blablabla</title> </item> ...(more items here) </items> Thanks, Paul
vitor Posted June 24, 2013 Posted June 24, 2013 (edited) Hey Guys, I was playing around with the Script Filter XML a bit and now I have the following script, which does not work, but I cant tell why: cat << EOB echo "<?xml version='1.0'?>" echo "<items>" for line in $(gpg --list-keys | grep -E -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b") do echo "<item uid='$line' arg='$line'>" echo "<title>$line</title>" echo "</item>" done echo "</items>" EOB Strange thing is: When I execute the script in my bash an copy the output as xml in the ScriptFilter, everything works fine. I suspect escaping to be the problem, but can not get it to work... Any ideas? Why are you using both cat and echo? You should only be using one of them; remove the “cat << EOB” and “EOB” lines, does it work? Edited June 24, 2013 by Vítor
silberistgold Posted July 3, 2013 Author Posted July 3, 2013 Mmmmh, doesnt work either... I uploaded the Workflow, so you can test it. Maybe it works for you. Keep in mind that you need need gpgTools installed: https://gpgtools.org/ Download Workflow: http://d.pr/f/AJbK Thanks Very Much
vitor Posted July 3, 2013 Posted July 3, 2013 Mmmmh, doesnt work either... I uploaded the Workflow, so you can test it. Maybe it works for you. Keep in mind that you need need gpgTools installed: https://gpgtools.org/ Download Workflow: http://d.pr/f/AJbK Thanks Very Much Have you installed gpg via homebrew, or a similar tool? It’s an easy to solve, but frustrating problem. Since Alfred does not read your PATH, you need to add something like PATH=/usr/local/bin:$PATH (or wherever you have gpg installed) to the top of your script, so it can find it.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now