op.insertAtEndOfList

Syntax op.insertAtEndOfList (string)

Params string is the heading to be inserted as the last subhead of the heading on which the bar cursor is positioned.

Action Adds a new subhead labeled string as the last subhead at the next level below the heading on which the bar cursor is located. If the current line has no subheads, this command creates one at the next level. If the current line has at least one subhead at

the next level, this command creates a new one and places it at the end of the list of next-level subheads.

Returns True

Examples In examples.Sample Outline 2, place the bar cursor on "Subhead 1.1" and then execute:
op.insertAtEndOfList ("New Heading")


   » true

The new heading appears at the same level as Subhead 1.1.1 (the third level), and is labeled "New Heading."

In examples.Sample Outline 2, place the bar cursor on "Subhead 1.1.1.1.1" and then execute:
op.insertAtEndOfList ("New Level 7 heading")


   » true

The new heading appears indented from Subhead 1.1.1.1.1, at the seventh level of the outline, and is labeled "New Level 7 heading."

In examples.Sample Outline 1, position the bar cursor on "Subhead 3, Summit 2" and then execute:
s = op.getLineText ();

op.go (left, 1);

op.insertAtEndOfList (s)


   » true

A new line, also labeled "Subhead 3, Summit 2" is inserted after the heading "Subhead 4, Summit 2." When subheads are similarly labeled, you can use this method of creating new lists of entries and then you can manually edit them later.

Notes The bar cursor is left on the newly inserted heading.

See Also op.insert

Discuss