Get Links from Lasso Selection
viaPluginNoteAPI.getLassoLinks
get link data within the current lasso selection. Example:
result is empty. If links exist, it returns an array of Link.
For details, see the API reference: PluginNoteAPI.getLassoLinks.
Link.linkType follows the type definition. Read APIs may return linkType=6 (digest link).
The current plugin APIs do not support creating or modifying digest links (write APIs such as insertTextLink and modifyLassoLink usually only allow 0..4), but you can read digest link data for display or detection.Text Links
There are two link categories in NOTE: text links and stroke links. Links can only be created/modified on the main layer; other layers are not supported. This section explains how to create a text link. CallPluginNoteAPI.insertTextLink to insert a text link into the main layer of the current page of the currently opened note.
insertTextLink takes a TextLink object and inserts a text link into the main layer of the current page.
To jump to a specific page in a note, set linkType to 0.
To jump to a page in a document, set linkType to 2. When linkType === 2:
destPage < 0: jump to the document current page (or the first page)destPage >= 0: jump to the target document page
linkType === 4 (URL), destPath must be the URL; destPage can be set to 0.
Stroke Links
Stroke links turn strokes into links. A stroke can be a normal stroke or a geometric shape. To create a stroke link, you must lasso the target strokes first. The lasso selection should only include strokes/geometries (not TextBox elements, titles, etc.).Selected strokes must be on the main layer; other layers cannot be used to create links.
PluginNoteAPI.setLassoStrokeLink
to set lasso-selected elements as a link. Example:
setLassoStrokeLink takes an object similar to TextLink, but without rect, fontSize, fullText, showText, and isItalic, because stroke links do not need these fields.
Modify a Lasso Link
You must create a lasso selection before modifying a link. UsePluginNoteAPI.modifyLassoLink:
PluginNoteAPI.modifyLassoLink can modify both text links and stroke links. Text links require fullText and showText; stroke links do not.
PluginNoteAPI.modifyLassoLink modifies a single link. If multiple links (or other elements) are included in the lasso selection, this call will fail.