target.set
| Syntax |
target.set (addr)
|
| Params |
addr is the Object Database address of the object you wish to become the target for future Frontier verb execution.
|
| Action |
Redirects all future Frontier verbs to the object at addr until a target.clear () or target.set (nil) resets the situation to its normal state.
|
| Returns |
The previous target, or nil if there was no previous target.
|
| Examples |
Open examples.list1 and examples.letter. Make sure examples.letter is the frontmost window. Now type and execute: local (oldTarget); msg ("The old target was: " + target.get ()); clock.waitSeconds (2); oldTarget = target.set (@examples.list1); msg ("The current target is: " + target.get ()); clock.waitSeconds (2); target.set (oldTarget); msg ("The target has been reset to: " + target.get ());
|
| Notes |
When the target is set, it is opened into a hidden window (if it wasn't already open in a window). You should always save the result of target.set in a local variable, so that you can restore the target when your script is finished with that object. Every thread has its own target, so you do not need to protect the target with semaphores. target.set (nil) is equivalent to target.clear ().
|