GetRegion System Query Command

GETREGION Dialog Box Queries

Opens a small dialog box to instruct the user to click on the page to return a coordinate value to the script. The requester has a Cancel button.

getregion [MESSAGE message]

stem/a Gets the coordinates of the region.

MESSAGE/s The message to display in the dialog box.

Max length=55.

Results:

If Cancel is chosen, it sets RC to 10. If the user clicks on the page or draws a region, it sets RC to 0 and returns the coordinates to the stem variable.

stem

x1/d The start horizontal coordinate.

y1/d The start vertical coordinate.

x2/d The end horizontal coordinate.

y2/d The end vertical coordinate.

Examples:

'getregion coord message "Drag to define an area"'
button=RC
if RC=0 then do
say coord.x1
say coord.y1
say coord.x2
say coord.y2
end

 

GetRegion  Command Definition  url:PGScmd/getregion
  created:2006-03-30 22:20:08   last updated:2006-03-30 22:20:08
  Copyright © 1985-2024 GrasshopperLLC. All Rights Reserved.

User Contributed Comments For GetRegion
Dan Kilroy wrote...2006-05-04 16:42:01

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

Gets the {...} .

GetRegion (&mouse/.X1.Y1.X2.Y2 [MESSAGE message])

Parameters:


Results:


Notes:


See Also:


Examples:
Python:


ARexx:

Applescript:

Tim Doty wrote...2007-05-26 16:48:28

The first time I tried this command it did not seem to work: no amount of clicking or dragging convinced the requester to close. I eventually clicked the 'Cancel' button which worked. The second attempt worked so I'm not sure what went wrong the first time.

Python:

>>> print GetRegion('coord', 'message', "Drag to define an area")
{'.errno': 1006, '.error': 0, '.result': 0, '.errstr': 'No Tag'}
>>> print GetRegion('coord', 'message', "Drag to define an area")
{'.error': 1, 'coord': {'y1': 0.25, 'x2': 4.25, 'x1': 0.25, 'y2': 3.25}, '.result': 0}

User Contributed Comments For GetRegion