![]() | Mac OS X-specific |
|---|---|
The Mac OS X Convenience API is only available for the Squish for Mac OS X editions. |
![]() | Terminology |
|---|---|
The Squish documentation uses the term widget when referring to GUI objects. Mac OS X developers may be more familiar with the term view for this concept. |
Here are some quick links to the Mac OS X Convenience API's functions:
This function activates the objectOrName menu
item. This menu item must be a reference to (or a name that identifies)
an NSMenuItem or a Carbon menu item. The menu item
can be part of the application menu or a menu item inside an
NSPopUpButton.
This function is identical to mouseClick.
It is included only for compatibility with old scripts. It should not be
used in new scripts since it may eventually be removed from Squish.
This function is identical to mouseClick.
It is included only for compatibility with old scripts. It should not be
used in new scripts since it may eventually be removed from Squish.
This function double-clicks the mouse on the specified
objectOrName widget.
By default the object is clicked in the middle, but this can be changed
by passing object-relative coordinates, x and
y. By default button 0 (the primary button)
is used, but this can be changed by specifying the optional
button argument. Similarly a default
modifier state of 0 (no modifiers) is used, but this can be
changed by specifying the modifierState argument.
Note that to specify the modifier, the button must also be specified,
and to specify the modifier, the position must be specified.
See Mac Convenience Function Parameters for which
values are valid for the modifierState and for
the button arguments.
This function installs a global event handler. The script function
named in handlerFunctionName (which must be passed
as a string, not as a function reference), will be called when an event
of the eventName type occurs.
The eventName can be the name of any of the
following event types:
When the SheetOpened event occurs, the function
named in handlerFunctionName is called. The
function is passed one argument—the window object that opened the
sheet. If you want to access the sheet itself, call the
attachedSheet function on the
NSWindow object.
When the WindowOpened event occurs, the function
named in handlerFunctionName is called. The
function is passed one argument—the window object that was opened.
The event occurs only for toplevel windows (NSWindow and
NSPanel objects), but it does not occur for windows that
are shown as sheets. Use the SheetOpened event if
you are interested in sheets.
For examples see How to Use Event Handlers (Section 13.8).
![]() | The AUT Must be Running |
|---|---|
The |
This function clicks the mouse on the specified
objectOrName widget.
By default the object is clicked in the middle, but this can be changed
by passing object-relative coordinates, x and
y. By default button 0 (the primary button)
is used, but this can be changed by specifying the optional
button argument. Similarly a default
modifier state of 0 (no modifiers) is used, but this can be
changed by specifying the modifierState argument.
Note that to specify the modifier, the button must also be specified,
and to specify the modifier, the position must be specified.
See Mac Convenience Function Parameters for which
values are valid for the modifierState and for
the button arguments.
This function moves the mouse to the center of the
objectOrName widget, or if coordinates are
specified, to position x and
y relative to the
objectOrName widget.
This function is useful if you want to trigger events that need the mouse to be at a particular position. For example, tooltips normally only appear when the mouse is over a certain area.
This function ensures that the objectOrName
widget is visible in the scroll widget that contains it, by scrolling if
necessary.
If there are nested scroll widgets, the innermost one that contains the
objectOrName widget is the one that will be
scrolled.
Currently this function only works for NSView
subclasses and for items in a NSTableView. If you
need support for other classes, contact froglogic support.
This function types the specified text (as if the
user had used the keyboard) into the objectOrName
editable widget. If the text is surrounded by angle brackets (<>),
it is interpreted as a key combination, e.g
"<Ctrl+Return>". The input is case-sensitive, so
type(object, "R") is different from
type(object, "r").
The following non-printable keys are supported in key combinations:
<Ctrl>,
<Command>,
<Shift>,
<Option>,
<Up>,
<Down>,
<Left>,
<Right>,
<Del>,
<Return>,
<Tab>,
<Backtab>,
<Esc>,
and
<Backspace>.