selected$

A function that can be used in Formulas.

## Syntax and semantics

`selected$` ( )
  return the full name (type + given name) of the topmost selected object.
`selected$` (`i`)
  return the full name (type + given name) of the ith selected object (as counted from the top, or from the bottom if `i` is negative).
`selected$` (`type$`)
  return the given name of the topmost selected object of type `type$`.
`selected$` (`type$`, `i`)
  return the given name of the ith selected object of type `type$` (as counted from the top, or from the bottom if `i` is negative).

## Usage

This function is useful if you want to write or draw the name of the object. For selecting an object, using `selected` is safer, as explained in Scripting 4.3. Querying objects.

### Links to this page

- Functions