randomnumbergenerator Posted March 29, 2013 Share Posted March 29, 2013 I'm trying to generate a URL based on a query that I give to Alfred. I set up the XML the following way. It looks like the "arg" attribute doesn't like the ampersands in the URL. If I remove the ampersands it seems to work correctly and passes it to the next step in the workflow. <?xml version="1.0"?> <items> <item uid="sview" arg="http://maps.google.com/maps?q=&layer=c&cbll=37.33741330000001,-122.04509040&cbp=12,0,0,0,0"> <title>http://maps.google.com/maps?q=&layer=c&cbll=37.33741330000001,-122.04509040&cbp=12,0,0,0,0</title> </item> </items> Is there a way I can work around this? I'm trying to generate a Google street view URL based on a street address that I enter. I have a perl script that queries the Google Maps server to get the latitude and longitude for and address and generate the URL. I want to pass this URL to Google Chrome. Link to comment
randomnumbergenerator Posted March 29, 2013 Author Share Posted March 29, 2013 OK. I figured this out. I wasn't familiar with XML. Ampersands need to be escaped in XML: http://stackoverflow.com/questions/1328538/how-do-i-escape-ampersands-in-xml Link to comment
Andrew Posted March 29, 2013 Share Posted March 29, 2013 This might be better achieved if you just use a Keyword Input to get the address, then pass into a static Run Script action to process the query, rather than dynamically creating the XML for the results. Link to comment
randomnumbergenerator Posted March 30, 2013 Author Share Posted March 30, 2013 (edited) Yes this would be better. Can I get the workflow to send the output from "Run script" to "Open URL". When I add "Run script", it's in the same "column" as "Open URL" so I can't connect the two. Edited March 30, 2013 by randomnumbergenerator Link to comment
Andrew Posted March 30, 2013 Share Posted March 30, 2013 Yes this would be better. Can I get the workflow to send the output from "Run script" to "Open URL". When I add "Run script", it's in the same "column" as "Open URL" so I can't connect the two. At the end of your Run Script, just use the open command (or similar) to open the URL instead of passing it into a separate Open URL action. Link to comment
randomnumbergenerator Posted April 10, 2013 Author Share Posted April 10, 2013 (edited) Thanks. Just use "open {query}". Edited April 10, 2013 by randomnumbergenerator Link to comment
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