GetCursor Text Query Command

GETCURSOR Text Queries

Gets information about the cursor or text selection(s).

getcursor [INDEX number] [TYPE string] [ARTICLEID handle] [FRAMESTART number] [FRAMEEND number] [FRAMESTARTID number] [FRAMEENDID number] [OBJECTID number] [LINESTART number] [LINEEND number] [CHARACTERSTART number] [CHARACTEREND number] [POSITIONSTART stem] [POSITIONEND stem] [DOCUMENT name/S | WINDOW name/S]

INDEX/i The text selection / cursor position about which to get information.

Default=1.

TYPE The type of text block

ARTICLEID/i The article ID of the article of the cursor position or text selection.*

FRAMESTART/i The first frame in the selection.*

FRAMEEND/i The last frame in the selection.*

FRAMESTARTID/i The object ID of the first frame in the selection.*

FRAMEENDID/i The object ID of the last frame in the selection.*

OBJECTID/i The object ID of the text block.**

LINESTART/i The ID of the first selected line.

LINEEND/i The ID of the last selected line.

CHARACTERSTART/i The ID of the first character selected.

CHARACTEREND/i The ID of the last character selected.

POSITIONSTART/a The position of the cursor or start of the selected text.

POSITIONEND/a The position of the end of the selected text.

DOCUMENT/s The document name. Default=current.

WINDOW/s The window name. Default=current.

* apply only to text frames; will return 0 for

frameless text blocks.

** apply only to text blocks; will return 0 for text

frames.

Results:

TYPE string/k The type of object: ARTICLE (text frame) | TEXTOBJ (text block).

POSITIONSTART stem

x/d The horizontal coordinate

y/d The baseline coordinate

top/d The top of slug coordinate

bottom/d The bottom of slug coordinate

POSITIONEND stem

x/d The horizontal coordinate

y/d The baseline coordinate

top/d The top of slug coordinate

bottom/d The bottom of slug coordinate

Notes:

If there is only one cursor position or text selection, INDEX should be 1. If there are multiple text selections, (found out with getcursorcount, you may want to use this command more than once to get information about each selection.

FRAMESTART and FRAMEEND will be equal if no text is selected.

CHARACTERSTART and CHARACTEREND will be equal if no text is selected.

LINESTART, LINEEND, CHARACTERSTART and CHARACTEREND numbers don't have any value by themselves. They take into account hidden commands and are therefore not suitable for counting the number of characters selected.

Examples:

getcursor characterstart start characterend end

 

GetCursor  Command Definition  url:PGScmd/getcursor
  created:2006-03-30 22:20:06   last updated:2006-03-30 22:20:06
  Copyright © 1985-2017 GrasshopperLLC. All Rights Reserved.

User Contributed Comments For GetCursor
Dan Kilroy wrote...2006-05-04 16:54:32

Script command submitted from PageStream internal documentation. Needs to be checked and merged with the command documentation above.

Gets the {...} .

GetCursor ([INDEX index] [TYPE &seltype/<ARTICLE | TEXTOBJ>]
for seltype == ARTICLE [ARTICLEID &id]
for seltype != ARTICLE [OBJECTID &id]
[FRAMESTART &start][FRAMEEND &end] [FRAMESTARTID &startid][FRAMEENDID &endid] [LINESTART &start][LINEEND &end] [CHARACTERSTART &start][CHARACTEREND &end] [POSITIONSTART &start/.X1.Y1.TOP1.BOTTOM1][POSITIONEND &end/.X2.Y2.TOP2.BOTTOM2] [DOCUMENT document | WINDOW document~window])


Parameters:


Results:


Notes:


See Also:


Examples:
Python:


ARexx:

Applescript:

User Contributed Comments For GetCursor