Bert Van Elsacker wrote:
>> No, there is currently no way to test if a search command will fail.
>
> Well, I'd like to add this feature to the wish list. It would make it
> possible to write a macro which does something with all occurences of
> a particular string (which is already possible) AND returns the caret
> to the original position (which is not possible now because the last
> search operation fails and halts macro execution).
>
Done. Excerpt of the changes.html of XXE v3.5.1 (to be released; not
before several weeks):
===
Command search now works as expected. Example:
---
<cfg:macro>
<cfg:choice>
<cfg:command name="search" parameter="Hello"/>
<cfg:command name="alert" parameter="'Hello' not found" />
</cfg:choice>
</cfg:macro>
---
If string "Hello" cannot be found after caret location then command
search cannot be executed and in such case, the dialog box of command
alert is displayed. Previously, unless the document contained no text at
all, command search always claimed to be executable and this, whatever
the searched string.
===