Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

pja2536

macrumors member
Original poster
Apr 8, 2015
73
15
Batemans Bay, Australia
Hi!

Is there a way of using Apple Shortcuts to find and replace text with in a text string.

For example: I use inline images in Markdown documents.

The image file name might be something like:

"The image I want to display.jpg"

For the Markdown preview to display this image it needs to be in the form:

"The%20image%20I%20want%20to%20display.jpg"

So I am trying to write a Shortcut that will take to original file name from the Clipboard and replace every "space" with "%20"

Can this be done.

By the way, I am Ok with the reading the Clipboard content into a variable and copying the variable back to the Clipboard. It's just the find and replace I'm having difficulty with.

Regards,
Peter
 
It worked OK when I tried:

Replace Text action
Replace <space character> with %20 in <variable>


Set the input variable to be:

The image I want to display.jpg

I successfully got:

The%20image%20I%20want%20to%20display.jpg
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.