how move items up / down a list?

Everything related to our flagship word processor.
ronald
Posts: 20
Joined: 2017-05-12 03:35:25

how move items up / down a list?

Post by ronald »

Hello,
How does one move items up and down (and if possible left and right) in a list?
How do I configure the corresponding shortcuts ?
thanks very much !!
adryan
Posts: 561
Joined: 2014-02-08 12:57:03
Location: Australia

Re: how move items up / down a list?

Post by adryan »

G’day, Ronald et al

Moving list items to the left or right (ie, decreasing or increasing the list level of an item) can be accomplished in various ways. Here are some of them:–

(1) Place the cursor anywhere in the item in question, then use Cmd+Option+right_arrow (⌘⌥→) to move the item to the right, or Cmd+Option+left_arrow (⌘⌥←) to move the item to the left.
(2) Place the cursor at the beginning of the item in question, then hit the Tab key to move the item to the right, or Shift-Tab to move it to the left.
(3) Place the cursor anywhere in the item in question, then choose from the main menu: Format > Increase [or Decrease] Indent. You will notice here that Nisus Writer already provides shortcuts for these commands, as used in Method 1 above.
(4) Place the cursor anywhere in the item in question, then choose from the drop-down menu in the List Toolbar Item: Increase [or Decrease] Indent.
(5) Place the cursor anywhere in the item in question, then increase or decrease the level in the Lists Palette from the Palette Library.

Moving list items up or down is something you need to do manually by cutting and pasting the relevant paragraph(s) into the required position in the list. If it’s an ordered list, Nisus Writer takes care of the ordering (eg, numbering) automatically. One could write macros to shift items up or down, and perhaps assign shortcuts to these macros, but you’d probably want them to shift all the nested items as well.

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
Axbax
Posts: 22
Joined: 2017-02-04 11:55:59

Re: how move items up / down a list?

Post by Axbax »

Hi, does anyone know of a macro that can do this? Or could the developers implement this function? I use it a lot when I write in Scrivener/Ulysses/Bear/Word, so I'd love to see it implemented in Nisus as well.
Cheers
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: how move items up / down a list?

Post by phspaelti »

The following macro will move a list item down one. It will keep the item selected, so you can use it repeatedly to move down two or three. It can't handle multiple items.
Attachments
Move List Item Down.nwm.zip
(2.92 KiB) Downloaded 979 times
philip
Axbax
Posts: 22
Joined: 2017-02-04 11:55:59

Re: how move items up / down a list?

Post by Axbax »

This works very well. Thanks! But could you (or someone else) perhaps make one that moves up as well? (I tried, but I am not experienced with coding).
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: how move items up / down a list?

Post by phspaelti »

I improved the logic of the macro. So now I'm able to provide both a "Move Up" and a "Move Down". As before the macros only apply to one list item (along with all its child items) at a time. I considered the possibility of moving multiple items at once. But the problem is that there is too much potential for the user to make "bad" selections (e.g. having a selection start in one list and cross over non-list text and end in another list), and then having to resolve all such limit cases is more work than I am prepared to invest in this problem at this time. So while the macro preserves the whole selection, it only considers the list item at the starting point of the selection. Best usage is to place the cursor in/on the list item you want to move.

If the selection is in the last item of a (sub-)list "Move Down" will silently terminate and do nothing. And vice versa for "Move Up".

[2020/4/3 Macros replaced with new version that solves a problem with lists at the end of the document]
see viewtopic.php?p=36981#p36981
Last edited by phspaelti on 2020-04-03 05:26:53, edited 2 times in total.
philip
Axbax
Posts: 22
Joined: 2017-02-04 11:55:59

Re: how move items up / down a list?

Post by Axbax »

You are a star! This works like a charm and will be so helpful for my writing. Thanks!!

If you (or someone else out there) could make a similar macro to move table rows up and down, I'd be very thankful.
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: how move items up / down a list?

Post by phspaelti »

Moving table rows is a much easier problem. This macro will work for multiple selected rows too.
Attachments
Table macros.zip
(5.8 KiB) Downloaded 993 times
philip
Axbax
Posts: 22
Joined: 2017-02-04 11:55:59

Re: how move items up / down a list?

Post by Axbax »

Hi,
The list macros above have not worked well since the update to NWP 3. Could someone help and update the macro?
Cheers
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: how move items up / down a list?

Post by phspaelti »

Hi. In what way has it not worked well? I'm not aware of anything having changed in NWP 3.0 that would affect the functioning. So if you could let me know how the outcome of the macro is different from what you expect…
philip
Axbax
Posts: 22
Joined: 2017-02-04 11:55:59

Re: how move items up / down a list?

Post by Axbax »

Thanks for the quick response. I tested it again now - and of course it worked fine :D I have had some issues with menu keys / shortcuts in NWP since the update and I suspect that this may be the reason that the macro hasn't always worked as expected. The macro in itself seems to work well as I tested it now. Thanks!
writerhoward
Posts: 50
Joined: 2013-02-03 05:10:26

Re: how move items up / down a list?

Post by writerhoward »

I have a numbered list in NW3 with 25 items. I wanted to move #24 to #21. When I moved #24 up to #23 and then up to #22 it worked fine. But when I moved it up from #22 to #21, the macro changed the number of 21 to 1, so that the list then read this way:

19.
20.

1.
22.
23.
24.
25.

For your information, before I used the macro the list I had to restart the list at #21 because there were two non-list line between #20 and #21.

Can the macro be easily modified to accommodate my situation?

Howard
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: how move items up / down a list?

Post by phspaelti »

Hello Howard,
I take it you understand why this happens. Your item "21" has a restart on it which is some kind of invisible "memo" on the list item itself. Unfortunately the only way to know this is to look in the "Format:Lists" submenu, where the name of the first item changes from "Restart Numbering" to "Continue Numbering From Previous". And inside a macro the menus are not updated, so this can't even be checked. This is a bit of bummer, and frankly I think the set of list item commands in the macro language should be augmented to make this easier.

But here's another question: Why are you restarting the list at all? If you want to continue the list across intervening non-list content you should use the "Continue numbering across document content" feature in the style definition (in the style sheet).
Screen Shot 2019-02-28 at 17.16.47.png
Screen Shot 2019-02-28 at 17.16.47.png (53.57 KiB) Viewed 27834 times
philip
Axbax
Posts: 22
Joined: 2017-02-04 11:55:59

Re: how move items up / down a list?

Post by Axbax »

Hi,

After upgrading to NWP3 I experience an issue with this macro. See screenshots where I tried to move 333 above 222. A similar problem occurs when I try to move an item down the list. Can someone fix the macro to make it work in NWP3?

Thanks in advance!
Attachments
Screenshot 2020-04-02 at 15.56.19.png
Screenshot 2020-04-02 at 15.56.19.png (8.2 KiB) Viewed 22994 times
Screenshot 2020-04-02 at 15.55.54.png
Screenshot 2020-04-02 at 15.55.54.png (8.61 KiB) Viewed 22994 times
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: how move items up / down a list?

Post by phspaelti »

Hello Axbax,
The problem you are seeing has nothing to do with upgrading. It comes about because the last item in your list does not have a return. But now that you mention it, I can provide a fix for that.

See below:
Attachments
List macros.zip
(6.73 KiB) Downloaded 751 times
philip
Post Reply