EqualsNine Posted August 31, 2018 Share Posted August 31, 2018 (edited) First off I have to say that I don't know anything about coding and have been piecing this together using different workflows and other people's scripts. I'm trying to make a workflow that takes my selection in MacOS, decodes it using Base64 and then opens a background tab using the result of said decoding as the URL. The only problem now is that someone else's script (that I obviously don't understand at all) gives more than just the URL after decoding: If the final URL would be: facebook.com My Workflow currently returns: <?xml%20version="1.0"?>%0A<items><item%20uid="base64%20Decoded%20(Invalid%20characters%20replaced%20with%20?)"%20arg="facebook.com"%20valid="yes"%20autocomplete=""><title>https://mega.nz/#F!pvxF2bZL?</title><subtitle>base64%20Decoded%20(Invalid%20characters%20replaced%20with%20?)</subtitle><icon>icon.png</icon></item></items> So, the makeshift solution I'm trying to come up with is to delete 2 "keywords" from the query. The 2 "keywords" would be: <?xml%20version="1.0"?>%0A<items><item%20uid="base64%20Decoded%20(Invalid%20characters%20replaced%20with%20?)"%20arg=" and "%20valid="yes"%20autocomplete=""><title>https://mega.nz/#F!pvxF2bZL?</title><subtitle>base64%20Decoded%20(Invalid%20characters%20replaced%20with%20?)</subtitle><icon>icon.png</icon></item></items> since these are the same no matter what I'm decoding. Could someone help me with the deletion of these keywords? My workflow: https://dbr.ee/mxSw The workflow that I stole the decoding part from: https://dbr.ee/rHsF Edited August 31, 2018 by EqualsNine Formatting Link to comment
deanishe Posted August 31, 2018 Share Posted August 31, 2018 First of all, thanks very much for posting your workflow and being clear about your end goal (rather than only talking about your proposed solution). You may not know how to code, but you certainly know how to ask coders questions ? Here's a (hopefully) fixed version of the workflow. It's actually rather simpler to do that what you've cobbled together: you'd grabbed a Script Filter script, which is designed to show a list of results in Alfred, not a script designed to pass input to an Alfred action (the latter type is much simpler). As best as I can tell, however, Safari chokes on domains without a URL scheme, so the above workflow adds "http://" to the start of the decoded input if it doesn't already start with "http". vitor 1 Link to comment
EqualsNine Posted August 31, 2018 Author Share Posted August 31, 2018 Thanks for the quick response, works perfectly. You're the best! Link to comment
deanishe Posted August 31, 2018 Share Posted August 31, 2018 25 minutes ago, EqualsNine said: Thanks for the quick response, works perfectly. You're the best! No problem. You made it very easy to help you. 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