nebaon Posted January 28, 2022 Share Posted January 28, 2022 I want to take the {query} Input and build some URLs with that that take this input as a parameter. What I need to do for that is encoding the {query} to URL format with %20 for blanks. What is the best way to do that? I do not want to open the URL after that but use that as a snippet in a mail. Every idea is greatly appreciated. Link to comment
vitor Posted January 28, 2022 Share Posted January 28, 2022 (edited) It depends on your Workflow. By using a Run Script Action with Language /usr/bin/osascript (JavaScript), you can encode the input with function run(argv) { return encodeURIComponent(argv[0]) } Or, if you know the only thing you will need to encode are the spaces, use a Replace Utility. Edited January 28, 2022 by vitor Link to comment
nebaon Posted January 29, 2022 Author Share Posted January 29, 2022 Thanks, Vitor. That is helpful. I’m not a coder so the function implementation is a bit beyond my capabilities. But the other tip might do to trick for now. Frustrating that this is not implemenented in the Workflows though.. Link to comment
vitor Posted January 29, 2022 Share Posted January 29, 2022 11 hours ago, nebaon said: the function implementation is a bit beyond my capabilities. It’s literally pasting that code without changes. Follow my instructions and the resulting Run Script object will take your input and spit out the encoded text for the next object, just like if it were another utility. Link to comment
nebaon Posted January 29, 2022 Author Share Posted January 29, 2022 Hey Vitor, oh, cool. I wasn’t aware of that. Trying that out soon myself. Thanks a million. Best, David Link to comment
Sridhar Katakam Posted January 26, 2023 Share Posted January 26, 2023 For anyone looking to do the same here's another (newer?) way: Link to comment
alfred1024 Posted October 13, 2023 Share Posted October 13, 2023 On 1/25/2023 at 10:06 PM, Sridhar Katakam said: For anyone looking to do the same here's another (newer?) way: Hi Sridhar, Thanks for posting these. Could you sharing this with us, and possibly add url decode functionality in this workflow as well? Link to comment
vitor Posted October 13, 2023 Share Posted October 13, 2023 Just now, Alfreder said: Could you sharing this with us You can build it yourself quite easily, no coding necessary. Including the decoding part. It’s just connecting a Universal Action to an Automation Task to a Copy to Clipboard Output. See the Getting Started Guide for an interactive tutorial on making a workflow. Link to comment
alfred1024 Posted October 13, 2023 Share Posted October 13, 2023 5 minutes ago, vitor said: You can build it yourself quite easily, no coding necessary. Including the decoding part. It’s just connecting a Universal Action to an Automation Task to a Copy to Clipboard Output. See the Getting Started Guide for an interactive tutorial on making a workflow. Got it, thanks for the comments. Link to comment
vitor Posted October 13, 2023 Share Posted October 13, 2023 If you need any specific help, don’t hesitate to ask. But I think you’ll benefit more from building it yourself since you’ll be able to make other things. When you’re feeling more confident, check the Good for Learning workflows in the Gallery for ideas or more advanced techniques. All of those are done without code. 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