Execute a Shell Script and using the clipboard input

I'm sure this is terribly obvious to terminal gurus, but I'm struggling even after viewing the "Execute a Shell Script" page.

If I copy an item ID for a website into the system clipboard (it will be something K1234), how can I append that to a URL in order to grab the source code from a webpage that uses that in its URL.

such as:
https://somewebsite.com/K1234

Literally every other part of my KM shortcut works, I just need to be able to create the URLs on the fly by concatenating the copied item ID to the base URL.

ScreenShot 2020-07-16 at 04.59.45

Hope that makes sense. This literally just uses curl to fetch the website source code for a page that contains details about something with the item ID that was in the clipboard.

Any reason you couldn't use KM's built-in Get URL action for this?

1 Like

Not sure how I missed that! TYVM!

1 Like

Note that that will work only if the text in the system clipboard is properly formatted for a URL.

If it might not be (if it might have anything other than very simple text characters like alphanumerics) then you probably need to encode it using the Filter action to Percent Encode for URL.

1 Like