garyinsf Posted February 23, 2018 Posted February 23, 2018 Hi everybody. I'm starting to explore workflows and I'm stuck on how to get Alfred to add line breaks <br> to ends of lines in plain text. For example, I would like the following text Line 1 text Line 2 text Line 3 text to be manipulated to Line 1 text<br> Line 2 text<br> <br> Line 3 text<br> Hope someone can point me in the right direction. Thanks, Gary
vitor Posted February 23, 2018 Posted February 23, 2018 (edited) Welcome @garyinsf, This can be accomplished with the Replace Utility. Instead of (\n) and <br>$1, a better method would be to use \n and <br> and ⌥↵ after the <br> to enter a new line (but that doesn’t translate to a screenshot). I can’t be more specific unless you specify how you want your Worlflow to work (or better yet, upload it for us to see). That utility will act on whatever text is passed to it and pass it through to the next node (which should probably be a Copy to Clipboard Output). Edited February 23, 2018 by vitor
garyinsf Posted February 23, 2018 Author Posted February 23, 2018 Thanks Vitor. I have set up the Replace as you have done above. I am manipulating clipboard contents and pasting using the Alfred hotkey for the workflow. However it is only pasting the exact text I copy without adding the <br>s.
vitor Posted February 24, 2018 Posted February 24, 2018 Has stated before, we can’t properly help you without access to your Workflow. Debugging can already be hard with access to the code, and you’re asking us to guess yours from a description and a screenshot. There are multiple places where you code or Workflow setup may be going wrong. Without looking at it we’re shooting in the dark. See the Reporting Problems with Workflows topic, as it gives a nice overview on how to build an effective report.
garyinsf Posted February 24, 2018 Author Posted February 24, 2018 Sorry. Here is a link to the workflow in question. https://www.dropbox.com/s/1eyq7dm8ulaqf2z/Add linebreaks.alfredworkflow?dl=0 I am running Alfred 3.6 Mac OS 10.11.6 Thanks, Gary
vitor Posted February 24, 2018 Posted February 24, 2018 You wrote /n (wrong slash). It needs to be \n.
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