Search found 256 matches

by js
2021-04-09 03:19:03
Forum: Nisus Writer Pro Macros
Topic: How to apply user hilite to selected text
Replies: 2
Views: 8471

How to apply user hilite to selected text

I think a user hilite can be defined like this:

$myHilite = Color.newWithRGB(255, 255, 163)
Set Highlight Color $myHilite

But how can myHilite be applied to the acutal text selection?
by js
2019-11-06 11:09:56
Forum: Nisus Writer Pro Macros
Topic: Get the caret out of a table
Replies: 10
Views: 17913

Re: Get the caret out of a table

Thank you Philip. This was very helpful indeed. Everthings works fine now, including your macro earlier revised. (Didn't know that you can modify earlier posts, so I didn't check). Of course it's far easier to shade cells than paragraphs in a table. But I am glad to know how it works for paragraphs ...
by js
2019-11-05 09:36:29
Forum: Nisus Writer Pro Macros
Topic: Get the caret out of a table
Replies: 10
Views: 17913

Re: Get the caret out of a table

You showed how to create shading attributes with a macro, and then asked: But maybe your problem is something else? How are you getting/making the table selection? To answer that: I made selections manually, by selecting (some or all) text within some cells. The menu "Show Paragraph Shading Pal...
by js
2019-11-05 09:21:22
Forum: Nisus Writer Pro Macros
Topic: Get the caret out of a table
Replies: 10
Views: 17913

Re: Get the caret out of a table

Thanks for explaining in detail. I think my problem was that I took the index of the table's start to be it's first cell.
About your short form of the macro you say "that should be fixed now". Did you maybe intend to post the fixed code?
by js
2019-11-04 10:35:26
Forum: Nisus Writer Pro Macros
Topic: Get the caret out of a table
Replies: 10
Views: 17913

Re: Get the caret out of a table

Thank you, Philip. Outquoting the line "$textRange.location = $textRange.bound" works fine. Some day I might understand why )=;
Your simplified version produces a system complaint: 'The Table object does not have a "text" property'.
by js
2019-11-04 06:21:20
Forum: Nisus Writer Pro Macros
Topic: Get the caret out of a table
Replies: 10
Views: 17913

Get the caret out of a table

My document starts with a table If the cursor is inside the table "Select Start" as expected selects the first cell of the table. If the cursor is after the table outside of it "Select Start" quite unexpectedly also selects the first cell of the table. Same thing after applying &...
by js
2019-10-02 05:34:27
Forum: Nisus Writer Pro Macros
Topic: Turning an integer into an array of its digits
Replies: 15
Views: 26820

Re: Turning an integer into an array of its digits

But why do you want to do this? If you want to find the keys that return such values, then why don't you just keep them (preferably in an array)? Or test on the fly? The only "advantage" of the subhash is that it will give you "key undefined" errors, if you ask about other keys....
by js
2019-10-02 03:15:05
Forum: Nisus Writer Pro Macros
Topic: Mark as Code
Replies: 0
Views: 11286

Mark as Code

I dont' understand anymore the "mark as code" function of this forum. If I mark a line as code and press Preview, the code appears properly marked in a window on top of my Draft window. But pressing submit does send the text of my Draft window with the marking tags, but not executing them....
by js
2019-10-02 03:03:32
Forum: Nisus Writer Pro Macros
Topic: Turning an integer into an array of its digits
Replies: 15
Views: 26820

Re: Turning an integer into an array of its digits

Interesting to have variant solutions. I tried all successfully. Thank you. I wonder if I may ask another, related question: If individual values of an hash contain several words or numbers, is there an easy way of creating a subhash with only pairs containing those words or numbers. Like $myhash = ...
by js
2019-09-29 05:38:18
Forum: Nisus Writer Pro Macros
Topic: Turning an integer into an array of its digits
Replies: 15
Views: 26820

Re: Turning an integer into an array of its digits

Thank you Philip, for your good explaining, as well as for your example hash which I would recommend Nisus to include in the Reference file.
by js
2019-09-29 04:19:35
Forum: Nisus Writer Pro Macros
Topic: Turning an integer into an array of its digits
Replies: 15
Views: 26820

Re: Turning an integer into an array of its digits

Thank you, Philip. I tried this and it works well for me. A thing I still don't quite understand is about hashes. There is a command to retrieve a value that goes with a key. But how can I retrieve the key if I know the value? Is it necessary to somehow apply the foreach function. Unfortunately I di...
by js
2019-09-27 11:00:29
Forum: Nisus Writer Pro Macros
Topic: Turning an integer into an array of its digits
Replies: 15
Views: 26820

Re: Turning an integer into an array of its digits

Thank you both Philipp and Martin. My main error was to ignore that the split function creates an array without further ado, and a lot of confusion if you do ignore that. As to the word integer I always thought that this is another word for a whole number. Is that not correct? What I wanted was in f...
by js
2019-09-27 08:54:16
Forum: Nisus Writer Pro Macros
Topic: Turning an integer into an array of its digits
Replies: 15
Views: 26820

Re: Turning an integer into an array of its digits

Thank you Philipp. It seems though that I make a mistake somewhere. My selection ("1", "2", "3", "4", "5") is put on the clipboard Following your advice I execute: $sel = Read Clipboard $arr = Array.new $arr.appendValuesFromArray $sel prompt $arr Wha...
by js
2019-09-27 07:08:09
Forum: Nisus Writer Pro Macros
Topic: Turning an integer into an array of its digits
Replies: 15
Views: 26820

Turning an integer into an array of its digits

I would like to transform a multi digit integer into an array made of its digits. Using the split function I can transform $int = 12345 into $list = ("1", "2", "3", "4", "5") But $arr = Array.new($list) does not produce an array with 5 elements. Rath...