Page 1 of 1

How to change default action in Find Nearby Words.nwm–Solved

Posted: 2013-10-18 08:54:58
by CrisB
Hi, I find the attached Find Nearby Words macro very, very useful - thanks again Martin.

Yet I always want the expression put into the Find panel, so I can modify it later if needed.

How do I modify this section so the default action changes and the expression, by default, goes into the Find panel?

# ask user what to do
$button = Prompt 'What should be done with those words?', '', 'Find All', 'Set In Find Panel'
$expression = "$first(AnyTextCharacter)(1+ Shortest)$second(Or)$second(AnyTextCharacter)(1+ Shortest)$first"
If $button == 'Set In Find Panel'
Write Find Expression $expression
Show Find
Exit
End

Thanks for your help,
Cris

Re: How to change default action in Find Nearby Words.nwm

Posted: 2013-10-18 14:37:09
by martin
CrisB wrote:Hi, I find the attached Find Nearby Words macro very, very useful - thanks again Martin.

Yet I always want the expression put into the Find panel, so I can modify it later if needed.

How do I modify this section so the default action changes and the expression, by default, goes into the Find panel?
That's not difficult, just switch the order of the button labels in the Prompt command, eg:

Code: Select all

$button = Prompt 'What should be done with those words?', '', 'Set In Find Panel', 'Find All'
The first label is for the default button.

Re: How to change default action in Find Nearby Words.nwm

Posted: 2013-10-18 22:13:06
by CrisB
Brilliant, it works perfectly...

thanks a million, Cris :-)

Re: How to change default action in Find Nearby Words.nwm–So

Posted: 2013-10-20 11:56:46
by CrisB
Guess I should have attached the latest version of this macro...

Cris