Page 1 of 1

How to create Find Action with Return (¶) character?

Posted: Tue Sep 05, 2017 9:55 am
by Icelander
Dear Avner et al.

Is it possible to create a Find Action consisting of just one Return (¶) character?

I have imported a long text document with paragraphs that look like this:

Blaablaa blaablaa blaablaa blaablaa blaa-
blaa blaablaa blaablaa blaablaa blaablaa blaablaa
blaablaa blaablaa blaablaa blaablaa blaablaa
blaablaa blaablaa blaablaa blaablaa blaablaa

[… other stuff with different format in between…]

Blaablaa blaablaa blaablaa blaablaa blaa-
blaa blaablaa blaablaa blaablaa blaablaa blaablaa
blaablaa blaablaa blaablaa blaablaa blaa-
blaablaablaa blaablaa blaablaa blaablaa blaablaa

I want it to look like this:
Blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa blaablaa

I am able to create a Find and Replace action by copying the Return character (¶) and insert a space into the Replace field, and then do Replace All in Selection. This works.
But when I try to *save* this as Find Action, it never works. To be precise, it appears to be saved and I can drag this Find Action into my FindSet, but it doesn't work when run.

I need to restrict this to Search in Selection because there is stuff interspersed, for example headings, that are not supposed to be changed.

So my questions are now:
1) Is it possible to use some other special character to search for the Return? I tried the regular expression \n but that didn't work.
2) Is it generally not possible in Mellel to build a Find Action with Return?

Addendum
I forgot to mention that after successfully replacing the returns per simple Find and Replace, many hyphens followed by space must also be deleted, because the text was hyphenated before the returns were removed. Here I face the same problem. I can do this per simple Find and Replace, but creating a Find Action doesn't work. If my understanding of FindSets is correct, then the ultimate goal here should be to run both Find Actions in one go, one after the other.

Re: How to create Find Action with Return (¶) character?

Posted: Wed Sep 06, 2017 1:19 pm
by Avner
This might be a usability issue we need to look at - this option is quite simple, but it is not accessible via the 'Insert' menu in the find panel, but rather through the Insert menu in the menu bar:

1. Open the Find panel.
2. Place your cursor inside the Find/Replace text box.
3. Choose Insert > Breaks > Return from the menu bar.

A return character should appear in the text box, allowing you to search for it and save it as a find action.

Re: How to create Find Action with Return (¶) character?

Posted: Wed Sep 06, 2017 7:00 pm
by Icelander
Thanks Avner, but this doesn't work either.

Perhaps you overlooked what I said about the *selection*.
I need to restrict this to Search in Selection
Anyway, a find action with "Search in Selection" and the above mentioned parameters doesn't work. However, you can create a find action with "Search in Everything" and that works.

This looks like a bug.
Can you please confirm whether this is true?

Thanks

Re: How to create Find Action with Return (¶) character?

Posted: Thu Sep 07, 2017 6:16 am
by Avner
Icelander wrote: Wed Sep 06, 2017 7:00 pm Anyway, a find action with "Search in Selection" and the above mentioned parameters doesn't work. However, you can create a find action with "Search in Everything" and that works.
Can you be a bit more specific regarding what you mean when you say 'Doesn't work'? I was able to create a find action that finds a return character in the current selection, save it and load it and it works just fine. What exactly is not working for you? Please detail the steps you have performed.

Re: How to create Find Action with Return (¶) character?

Posted: Thu Sep 07, 2017 11:34 am
by Icelander
Avner wrote: Thu Sep 07, 2017 6:16 am What exactly is not working for you?
The Find Action can not replace returns with a space *if* the Find Action is applied to a text selection. If no text is selected (= Search in: Everywhere), it works as expected, i.e. the returns are replaced with a space.

The details:
1. You have text like in screenshot 1 (http://www.mediafire.com/file/kpi1c2ya4ytcg81/1.png)
2. You want to replace the returns with a space so that the text looks like a normal prose.
3. First select 'Search in: Selection'
4. From the Insert menu > Breaks > Return you enter 'Return' into the Find box.
5. Place the insertion point into the Replace box and hit space.
6. At this point, a test shows that, when the 'Replace All' button is pressed, the replacement takes place as expected, that is, all returns in the selection are replaced with a space.
7. Now I save this as a Find Action. See screenshot 2 (http://www.mediafire.com/file/f5t0821ks6tect8/2.png)
8. When I now select the original raw, unaltered text and run the Find Action by clicking on the big top arrow in my FindSet, the returns in the text are NOT replaced by a space. The only thing that happens is that the selection in the document goes away, but no replacement takes place.
9. However, if I now repeat step 8 with "Search in: Everywhere" enabled, everything works as expected and the returns are replaced with a space. See screenshot 3 (http://www.mediafire.com/file/9ndufczuap7gmy5/3.png)

Is this a bug?

Re: How to create Find Action with Return (¶) character?

Posted: Mon Sep 11, 2017 12:49 pm
by Avner
I think it's a local issue you're having. I was able to get it to run fine on both Everywhere and In Selection selected following your instructions.

Can you please open a support request and attach your original document to it?

Re: How to create Find Action with Return (¶) character?

Posted: Mon Sep 11, 2017 1:55 pm
by Icelander
Avner wrote: Mon Sep 11, 2017 12:49 pm I was able to get it to run fine on both Everywhere and In Selection selected following your instructions.
Good to know then that it's just a local issue. Thank you Avner for your help.