Reply to topic  [ 4 posts ] 
How to change default action in Find Nearby Words.nwm–Solved 
Author Message
User avatar

Joined: 2006-09-25 10:30:11
Posts: 114
Location: Gibraltar, Europe
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


Attachments:
File comment: This macro finds any paragraph which contains two specified words in any order
Find Nearby Words.nwm [22.19 KiB]
Downloaded 176 times

_________________
Find strategies to improve your effectiveness at http://www.lifestrategies.net


Last edited by CrisB on 2013-10-18 22:16:18, edited 2 times in total.

2013-10-18 08:54:58
Profile WWW
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
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:
$button = Prompt 'What should be done with those words?', '', 'Set In Find Panel', 'Find All'

The first label is for the default button.


2013-10-18 14:37:09
Profile WWW
User avatar

Joined: 2006-09-25 10:30:11
Posts: 114
Location: Gibraltar, Europe
Brilliant, it works perfectly...

thanks a million, Cris :-)

_________________
Find strategies to improve your effectiveness at http://www.lifestrategies.net


2013-10-18 22:13:06
Profile WWW
User avatar

Joined: 2006-09-25 10:30:11
Posts: 114
Location: Gibraltar, Europe
Guess I should have attached the latest version of this macro...

Cris


Attachments:
File comment: This macro finds only paragraphs that contain both of two desired whole word matches.
Find Nearby Words.nwm [23.05 KiB]
Downloaded 162 times

_________________
Find strategies to improve your effectiveness at http://www.lifestrategies.net
2013-10-20 11:56:46
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software