|
Tell
|
|
Script Debugger gives you many ways to create a tell block targeting a particular application. You can insert a tell block into an existing script, or you can create a new script and insert a tell block into it, in a single move. If text is already selected, the inserted tell block will enclose it (no text will be destroyed).
These are valuable shortcuts because entering an application’s name manually at the start of a tell block is a tedious and error-prone operation. Also, most of the time, as you start to write a script you will already have in mind some application that you want to target, so creating a tell block is usually a better way to create a new script window than File > New Script!
In a script window, choose Edit > Paste Tell. (Alternatively, hold down the Control key and use the script window’s contextual menu.) The hierarchical menu lists all running scriptable applications and all previously encountered applications. Choose an application to insert a tell block targeting it.
In the dictionary window for an application, choose Dictionary > Paste Tell (or click the Paste Tell button in the dictionary window’s toolbar), to insert a tell block targeting that application.
In the Known Applications inspector, select an application and click the Paste Tell button.
In all of the above cases (except when using the contextual menu), if you hold down the Option key, a new window is created. Otherwise, you’re inserting into the frontmost script window. If there is no open script window, a new window is created.
- Drag-and-drop an application from the Finder into your script window. A dialog appears asking what you want to do. One option is to paste a tell block targeting that application.
(Alternatively, drag-and-drop an application’s name from the Known Applications inspector into your script window.)
- Type
ta followed by a space. If text substitutions are turned on, a tell block targeting the Finder is created, and the word “Finder” is selected, ready for you to type the name of a different application.