Hello,
I want to invoke a pop-up window for a selected paragraph. Just that. I don't want to do anything with said paragraph, only display it. My macro is like this:
Select Paragraph
$selection = TextSelection.active
Show Find Results $selection, "Selected paragraph"
Can anyone tell me what's wrong?
Getting a pop-up window for a paragraph
Re: Getting a pop-up window for a paragraph
Hi pereelmagne,
The Show Find Results command expects as argument a Hash where the key(s) have arrays of selection objects as values.
So you could modify your code as follows:
Try it and have a look at the result.
I just suspect that a better choice for what you are trying to achieve would be:
The Show Find Results command expects as argument a Hash where the key(s) have arrays of selection objects as values.
So you could modify your code as follows:
Code: Select all
Select Paragraph
$selection = TextSelection.active
$matches = Hash.new 'Selected Paragraph', Array.new($selection)
Show Find Results $matches
I just suspect that a better choice for what you are trying to achieve would be:
Code: Select all
$sel = Read Selection
prompt 'Selected Paragraph', $sel
philip
Re: Getting a pop-up window for a paragraph
Actually the following would also work, but the result(s) display a bit different:
Code: Select all
$doc = Document.active
Show Find Results $doc.textSelections, 'Selected Paragraphs'
philip
-
- Posts: 13
- Joined: 2015-06-27 01:38:22
Re: Getting a pop-up window for a paragraph
Thank you very much.
All three solutions work well. I will keep all them in my notes.
Best wishes,
Pere
All three solutions work well. I will keep all them in my notes.
Best wishes,
Pere
Re: Getting a pop-up window for a paragraph
A belated follow up about a Nisus feature that I had forgotten about. Nisus has a command "Edit > Select > Show Selection in Results Window", which would also achieve the desired effect.
philip