GotoNode Method (Article)

Build 1501 on 14/Nov/2017  This topic last edited on: 22/Mar/2016, at 17:07

Description

Edits the text of the specified node. It does not provide open as read-only - for that, see GotoNodeEx.

Available in Ted and in Fred.

Syntax

object.GotoNode objNode, bSrc, bOnly*

object

Required. Object name. Returned by Ted.GetActiveArticle or Fred.GetActiveArticle.

objNode

Node to edit. It must be a node object returned by a function such as GetCurNode.

bSrc

If true the text is edited in a source window, if false in the WYSIWYG window .

bOnly

THIS PARAMETER IS AVAILABLE ONLY IN TED, NOT IN FRED

If True the command fails if the window required by the bSrc parameters is not available. If False, and the required window type is not available, the other type is used - e.g. if bSrc=False (i.e. requested WYSIWYG editing) and bOnly=False, and there is no WYSIWYG window, the specified text is edited in a source window.

Remarks

If the text is already being edited, GotoNode just sets the focus to its editing window and positions the cursor at the beginning of the node's text, otherwise it opens an editing window for the text and then sets the focus.

In other words, GotoNode is like GotoTxt, except that it positions the cursor at the beginning of the node's text.  See also GotoTxt, and GotoNodeEx, to open the element in the specified mode (r/o, r/w), and GotoTxtEx.

Example

This script open in source pane the text currently selected in the tree.

If Ted.HasActiveArticle Then

 Dim objArticle = Ted.GetActiveArticle

 objArticle.GotoNode (objArticle.GetCurNode,True,False)

End If

 

In Fred, this command can be used but it does not do anything.

If Fred.HasActiveArticle Then

 Dim objArticle = Fred.GetActiveArticle

 objArticle.GotoNode (objArticle.GetCurNode,True,False)

End If