Editmenu.htmlTEXTVIZF2Ǵ߱߱ Edit menu

Edit Menu

The Edit menu is separated into five sections. The two topmost sections are standards of MacOS. The last section lets you open the Preferences dialog box. The two other sections are devoted, one to the Find / Replace / Compare commands, the other to the basic operations on scripts .

Undo, Redo and other titles  Z

Undo reverses the latest editing action done in the active window. The actual title of this menu varies depending on the exact nature of the editing taking place in the active window.
Note that "each window has its own undo". When you make a window active, you can undo the last action performed even if it was performed a long time ago - provided the changes have not been saved.

Cut  X

Removes the selection of the active window and places it on the Clipboard.

Copy  C

Copies the selection of the active window to the Clipboard.

Paste  V

Replaces the selection of the active window with the contents of the clipboard. Or, when this makes sense: puts the contents of the clipboard into the selection.

Clear

Deletes the current selection. This action is undoable.

Select All  A

Selects the entire contents of the active window. Or, when this makes sense: selects the team(s) of the selection.

The next four items are related to the 'Find' dialog box of Smile. These commands work only with script windows and text windows.

Find  F

Opens (or brings to front if it is already opened) the "Find" dialog box.

Find again  G

Finds and selects (highlights) the next occurrence of the search string after the current selection in the active window.
The "Find" dialog box need not be open.

Enter selection  E

Sets the search string to the text selected in the active window. The "Find" dialog box need not be open.
You can then use 'Find again' to find the next occurrences.

Find selection  H

Sets the search string to the text selected in the active window, and searches for the next occurrence of this string in this window. The "Find" dialog box need not be open.
You can then use 'Find again' to find the next occurrences.

Compare  K

This function compares the texts of the two frontmost windows, starting (in each window) at the end of the current selection. The 'Compare' function is not sensitive to differences in text style, font, or color.
When it finds a difference, the 'Compare' function highlights in each window the portion of text which it has found as being different. At this point, you may want, before jumping to the next difference, to change one of the windows. Use Copy - Paste, then press  K again, it will jump to the next difference.

If no difference is found, the message "The files are identical to the end." will be presented in a dialog box.

To copy from one window to the other, or to select the next difference, you may use the menu which is created in the bottom bar.

Run script  R

This menu item is enabled exclusively when the active window is a script window .
Selecting 'Run script' executes (runs) the entire script (all lines) of the active script window after successful compilation. Precisely, it launches the execution of the "run" (or unnamed) handler of the active script window. You can also use the small button with the "start" icon, in the bottom bar of the window.
The result of the execution of the script, if any, is appended by default to the "Worksheet". If the "Worksheet" is not open, it will be automatically opened by Smile. It is also possible to redirect the result of the script to other output windows .

Check syntax

As with 'Run script', 'Check syntax' is used exclusively with script windows.
Selecting 'Check syntax' will check the syntax of all lines of script of the active script window. This menu item performs the identical function as clicking the check-syntax button (checkmark icon  ), at the bottom of the script window .
You can also check syntax by pressing the Enter key while the script window is active. The Enter key is in the numeric keypad on the desktop keyboards. (The Enter key is not the carriage return key ). If your keyboard has no Enter key, you can alternately press the combination ctrl-C.
Note : unlike the menu command and the button, the 'Enter' key will force compilation even if the script has already been compiled successfully.
So, use the 'Enter' key if you want to reinitialize the values of the script properties before rerunning the script.

A successful syntax check may result in some of the script text being presented in a different text style and changed in format, depending on preference settings (see 'Preferences' dialog ).
An unsuccessful syntax check will result in a dialog box being presented. This dialog box may present information that you will find helpful in correcting the syntax.

Record

Starts the recording of user actions. While recording is active, the menu name will change to 'Stop' and the Apple menu  icon will flash between Apple and cassette symbols. While recording, user actions are monitored, and associated script lines are appended to the end of the active window (provided it is a text window or a script window).
Applications that are "recordable" can be of much help while writing scripts. Smile and Finder are two of many applications offering the beneficial combination of being both recordable and scriptable.

tell ...

You can link a text or a script window to a running application. Script lines that you execute in such linked windows are directly sent to the target application. Choose the 'tell ...' command to choose the target application for the front window. The name of the target application is then displayed in the bottom bar. See tell ... for all details.

Copy translate   C

(menu item active only if the front window has a target application)
Windows which have been linked to an application, using the 'Tell ...' menu, support a special 'Copy', named 'Copy translate (shortcut   C)'. When you choose 'Copy translate', the selected lines - provided they are compilable script lines - are copied " la AppleScript", i.e., as compiled lines. Then, doing a 'Paste' into a regular (text or script) window will paste the raw codes. This is a major help for making scripts universally portable to other Macs. 'Copy translate' can also be helpful to analyze terminology conflicts.

Find definition   F

This menu item searches the definition of the selected string.
You can use it to jump to the corresponding section of the relevant dictionary if the selected string is, either a verb, or a class name, either of Smile, or of an installed scripting addition.
If the front window has been linked to an application by the 'tell ...' menu item, then Smile will search, not in Smile's dictionary, but in the dictionary of the target application of the window - before searching the scripting additions' dictionaries.

Preferences

Opens the 'Preferences' dialog .

Agents

In Smile, this menu can be used only with graphic windows.
========================================================

Advanced

- The clipboard commands on text and script windows can be scripted. Here are two examples.

----------------------------
tell window 2 to paste

tell window 2 to undo
----------------------------

- By default, the Undo command applies to the last elementary editing action. If you script a complex text editing operation, you can make it undoable by encapsulating it as in the example below.

----------------------------
set store undo of window 1 to true
-- do some changes and text editing
set store undo of window 1 to false
----------------------------
hh_DirectoryPopup * * Filename: DirectoryPopup.c * * Author: Marco Piovanelli, * * Version: 1.0.5, November 1998 * */ #include "DirectoryPopup.h" //#include "Utilities.h" #ifndef __APPEARANCEK    k  "  k   k         !  &  D  U  V  b  d  i                %  &  A  C  I  M  kb  c  k    k   ?     k    k?    k    kO  W  kl  n ? o  q  kx  ~  k    kb  k  k   ?     k    k    kg  q  k   ?     k    k  w  k    k   P  k   k  ?   k   k    k   k   ,  Y  j  n   k   #  k 8  : ? ;  =  k D  J  k   k -  <  k Q  S ? T  V  k ]  c  k    k  I  k    k   ?     k    k    k    k$  7  kL  N ? O  Q  kX  ^  k  I  kM    k    k   ?     k    kT  +  k0  ;  kP  R ? S  U  k\    k  /  k8    k    k\  k  k   ?     k    k    A  R  V  [  k`    k            k7  G  k    k    k    k        #  (  k,    k    k  r  kv    k    k  9  m        k  =  k   k  !X  k!m  !r  k!y  "Z  k"_  #*  k#  #  k#  %)  %P  %\  %`  %v  k%  &  k&  & ? &  &  k&8  &: ? &;  &=  k&D  &J  k&  &  k&  '  k'  ' ? '  '  k'  ' ? '  '  k'  (  )  )B  )F  )  k*  *&  k*;  *= ? *>  *@  k*\  *^ ? *_  *a  k*h  *m  k*  *  k*  +  k+  +  ,  ,,  ,0  ,  k-r  -  k-  -  -  .  .  .  k.y  .  k.  .  k/)  /e  k/  /  k0  0f  k0n  0  k0  0  k0  0  k0  0  k1#  1  k1  2  k2  2<  k2@  2g  k2k  2  k2  2  k2  ~selelist longlongpbndlist8long"longmlonglongBDrwfalspvistrueWIDLfalsICFFlongrSiDlongptxfTEXTGenevaptpslong Rectlist8longlonglonglongWTBHlongRqULlongLWdtlongBrWdlongAuAdfalsTbSzlong hh_hH=TZstylSOUP&reco2iTcwtx