Jump to content

How to break lines in text replacement?


Recommended Posts

Hello guys, I'm looking for help in building a workflow, by replacing the certain words in a paragraph to English. 

Our order processing system is not in English, so we need to translate these information when communicating with our customers and it consumes a lot of time. 

I know how to use "replace text" but I just don't know how to make the text to go to a different line. 

 

The original text is as follow.

收件人: 
********
电    话: 
********
手    机: 
 
国家/地区: 
********
省  / 州: 
********
城    市: 
********
地 址 1: 
********
门牌号: 
 
地 址 2: 
 
邮    编: 
********
公    司: 
********
税    号: 
********
 
For example, I want "收件人" to be replaced with "Name",  "电    话" to be replaced with "contact number". but when all is done, there's no line breaks.
I tried <br> by making it part of the "replace with", like ---> Replace "收件人" with "name<br>", but it's not working and seems the <br> part was taken as plain text too.
 
Thanks for the help in advance! 
Link to post

Welcome @kimillian,

 

3 hours ago, kimillian said:

it's not working and seems the <br> part was taken as plain text too.

 

Because <br> is plaintext. It’s interpreted by HTML parsers as a line break, but that’s it.


Please upload your Workflow somewhere (transfer.sh is a fast solution without ads; drop your Workflow in the box in the middle) as we can’t properly help you without access to it. I’ve replicated a Workflow from your details and it seems to work fine, so by inspecting yours we’ll either better understand your issue or suggest where you’re going wrong.

Link to post

@kimillian Could you also please specify what app you're pasting into? Please test anything in plain text TextEdit, as it's the most standard native app. You'll then be able to establish whether the issue is with the destination app manipulating what you're pasting. For example, Google Docs tends to manipulate what you paste.

Link to post
On 8/5/2020 at 9:31 PM, Vero said:

@kimillian Could you also please specify what app you're pasting into? Please test anything in plain text TextEdit, as it's the most standard native app. You'll then be able to establish whether the issue is with the destination app manipulating what you're pasting. For example, Google Docs tends to manipulate what you paste.

Hello thank you for helping me out! 

https://drive.google.com/file/d/1kaqotdzmF_E76HUnDbZJ56YtB25evW71/view?usp=sharing

Can you try with this sample text:

Name: 
Mark Joe
电    话: 
(718) 350-**81
 
And see how I can make it:
Name: 
Mark Joe
Contact: 
(718) 350-**81
 
Instead of not switching lines?
Name: Mark Joe Contact:(718) 350-**81
 
Thanks a ton!
 
Link to post
9 hours ago, vitor said:

I don’t see what the issue is. Simply remove the <br> from the substitution and it works as you requested.

Hello Vitor,  my difficulty is that I need the replaced text to switch lines.

It seems that if I don't put <br> the text would simply go to one line without breaks. 

Name: Mark Joe Contact:(718) 350-**81
 
Link to post
Just now, kimillian said:

It seems that if I don't put <br> the text would simply go to one line without breaks. 

 

Something outside of Alfred is going wrong, then. Alfred doesn’t collapse your newlines like that. Which application are you pasting into?

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...