Using HomeSite
|
|
Testing and Maintaining Web Pages
|
Searching Documents
HomeSite provides basic and extended search capabilities. These enable you to find and replace alphanumeric strings-including regular expressions-across folders and projects, filter the files to search by file type, select how tags are processed by the search engine, automatically replace special and extended characters with their HTML equivalents, make a double-spaced document single-spaced, select documents to edit or browse from the search results, and more. This section describes each search capability.
Selecting search text
By selecting text in a document and invoking a search, HomeSite automatically inserts the selected text into the Find what text box.
In a basic search or replace, if the selected text exceeds 100 characters, no text is inserted into the Find what box, and HomeSite searches the selected text instead of the entire document. If you want to only replace text within a selection, you can select the Selection option in the Relace dialog box.
Optionally, you can configure HomeSite so that, when you do not select any search text, it selects the word nearest to the cursor position and inserts this word into the Find what box.
To enable nearest word search selection:
Saving search text
You can reuse search strings for basic and extended searches, but the method for saving the search text differs.
To save search text, do one of the following:
- In a basic search, search text is automatically saved.
- In an extended search, you can selectively save search text. Click the arrow next to the Find what box and select Save find text from the pop-up menu.
To use a saved search string in a basic search:
- Open the drop-down list for the Find what text box and enter one of the last ten search strings.
To use a saved search string in an extended search:
- In the Extended Find or Extended Replace dialog box, click the arrow button next to the Find what box and select Open find text from the popup menu.
- In the Open find text dialog box, select the search string to use and click Open.
Using basic search commands
You can perform a basic search or replace operation on the active document, even if it is an untitled, unsaved document.
To search the current document:
- Select Search > Find from the menu.
- In the Find dialog box, in the Find what box, enter the text that you need to find.
The last 10 items are saved in the Find what drop-down list. You can select from this list. You can also select text in the Editor to appear in the Find what box. For details, see "Selecting search text".
- (Optional) Select the Match whole words, Match case, and Direction options.
To set more advanced options, perform an extended search on the current document. For instructions, see "Performing an extended search".
- Click the Find Next button to sequentially highlight each match in the document.
- If the search dialog box closes, you can press F3 to resume the search from the current cursor position in the document.
To replace text in the current document:
- Select Search > Replace from the menu.
- In the Replace dialog box, in the Find what and Replace with boxes, enter the text to find and the text to replace.
The last 10 items are saved in the Find what and Replace what drop-down lists. You can select from these lists. You can also select text in the Editor to appear in the Find what box. For details, see "Selecting search text".
- (Optional) Select the Match whole words, Match case, and Direction options.
To set more advanced options, perform an extended replace on the current document. For instructions, see "Performing an extended search".
- Do one of the following:
- Click Replace to replace the first highlighted match and to highlight the next match in the document.
- Click Replace All to replace all matches without reviewing them first.
Using extended search commands
You can use the Extended Find and Extended Replace commands to perform more complex search operations across multiple documents.
Extended search and extended replace operations include untitled, unsaved documents. They are listed in the Results window by their tab label in the Editor (Untitled1, Untitled2, and so on).
The rest of this section provides instructions for performing extended search and extended search and replace operations.
Performing an extended search
This section contains instructions for performing extended searches in the current document, all open documents, in a folder, or in a project.
To perform an extended search:
- Select Search > Extended Find from the menu to display the Extended Find dialog box.
- Enter the appropriate text in the Find what box.
To re-use a previously saved search string, see "Saving search text".
- In the Find where box, select one of the following options:
- Current document to search the current document only, using more advanced options than are available in a basic search.
- All open documents to search all open documents, even those that are not yet saved.
- In folder to search the documents in a specific folder. You can select a folder from the drop-down box, type a full path, or browse to the folder.
To search documents in the folder's subdirectories, select Include subfolders.
If you want to limit your search to files of certain types, select a filter from the File Types drop-down box or type your own; for example, *.html;*.htm;*.txt.
- In project to search the documents in a project. You can select a project from the drop-down box, type a full path, or browse to the project.
If you want to limit your search to files of certain types, select a filter from the File Types drop-down box or type your own; for example, *.html;*.htm;*.txt.
- Select any of the following options as needed:
- Match case to only highlight a match if it has identical upper and lower case as the selection.
- Regular expressions to enable parsing of regular expression entries.
For information on the specific syntax to use for regular expressions in HomeSite, see "Using Regular Expressions".
- Skip tags while searching to search only the page content, not the tags themselves-especially useful when searching for words like width or value.
This option is not available when Regular expressions is selected.
- Exlude Binary Files to skip over binary files such as EXE, PDF, ZIP, and media file types. Searching these types of files would significantly slow down the search. HomeSite installs a list of excluded file extensions in the Windows Registry LinkVerifyExcludeExts key.
- Display Line Info to display the contents of the line in which the match was found. This slows down the performance in large searches.
- Click Find.
- To cancel the search operation, press the Esc key.
The Results window displays a list of documents matching the search string.
Performing an extended replace
This section contains instructions for performing an extended search and replace operation in the current document, all open documents, in a folder, or in a project.
Caution An extended replace operation cannot be undone. For best results, select the Make backups option. Also, an extended replace operation skips all read-only files.
|
To perform an extended replace:
- Select Search > Extended Replace from the menu to display the Extended Replace dialog box.
- Enter the appropriate text in the Find what and Replace with boxes.
To re-use a previously saved search string in the Find what box, see "Saving search text".
- In the Find where box, select one of the following options:
- Current document Replaces text in the current document only, using more advanced options than are available in a basic search and replace operation.
- All open documents Replaces text in all open documents, even those that are not yet saved.
- In folder Replaces text in the documents of a specific folder. You can select a folder from the drop-down box, type a full path, or browse to the folder.
To replace text in documents that are in the folder's subdirectories, select Include subfolders.
If you want to limit your search and replace operation to files of certain types, select a filter from the File Types drop-down box or type your own; for example, *.html;*.htm;*.txt.
- In project Replaces text in the documents of a project. You can select a project from the drop-down box, type a full path, or browse to the project.
If you want to limit your search and replace operation to files of certain types, select a filter from the File Types drop-down box or type your own; for example, *.html;*.htm;*.txt
.
- Select any of the following options as needed:
- Match case Only highlights a match if it has identical upper and lower case as the selection.
- Regular expressions Enables parsing of regular expression entries.
For information on the specific syntax to use for regular expressions in HomeSite, see "Using Regular Expressions".
- Skip tags while searching Searches only the page content, not the tags themselves-especially useful when searching for words like width or value.
This option is not available when Regular expressions is selected.
- Exlude Binary Files Skips over binary files such as EXE, PDF, ZIP, and media file types. Searching these types of files would significantly slow down the search. HomeSite installs a list of excluded file extensions in the Windows Registry LinkVerifyExcludeExts key.
- Display Line Info Displays the contents of the line in which the match was found. This slows down the performance in large searches.
- Make backups Select this for folder and project replace operations, because an extended replace cannot be undone. Backs up every file in the folder or project before performing the extended replace operation.
If you select this option, you must specify one of these backup locations:
Backup directory Backs up in the \AutoBackup folder in the program root; for example, C:\Program Files\Macromedia\HomeSite 5.0 \AutoBackup.
Original directory Backs up in the current directory. You can differentiate these files from your regular files by their name, since backed up files use the following naming convention: filename + an incremented 3 digit number + the file extension; for example, myfile000.htm.
For information about how HomeSite determines the current directory with two Files tabs, see "About the Files Tabs".
- Click Replace.
- To cancel the search and replace operation, press the Esc key.
The Results window displays a list of documents in which text was replaced.
Working with the results of extended search operations
After an extended search, the Results window displays a list of documents in which the search string was found and/or replaced. You can work with these search results in many ways; for example you can edit or browse the documents in which matches were found, or view the search results list in a browser.
To edit a document for a match:
- Double-click a match in the results list.
This opens the document in the Editor if it is not already open, and highlights the match in the document.
- Edit the file as necessary, and then save and close it.
To edit documents for more than one match:
- Highlight one or more matches in the search results list.
- Right-click the selection and select Open in Editor.
This opens every document in which the selected matches were found, and highlights the selected matches in the documents.
- Edit files as necessary, and then save and close them.
To open the search results in a browser:
To clear the search results:
- Right-click in the search results pane and select Clear.
Replacing extended and special characters
You can replace special and extended characters in the current document with their HTML equivalents; for example, you can replace "&" with &
.
To replace extended and special characters:
- Open the document in which to make the replacements, if it is not already open.
- Select Search > Replace Extended Characters from the menu.
Replacing double-spaced lines
Because of the way that different operating systems treat carriage returns, text files saved on UNIX or Macintosh systems might be double-spaced when you open them in HomeSite.
To make a double-spaced document single-spaced:
- Open the double-spaced document, if it is not already open.
- Select Search > Replace Double Spacing with Single Spacing from the menu.
The double-spaced lines are collapsed to be single-spaced lines.
Searching with regular expressions
You can use regular expressions (or RegExp) to match patterns in character strings during Extended Find and Extended Replace operations.
To search with regular expressions:
- Select Search > Extended Search or Search > Extended Replace as necessary.
- In the Extended Find or Extended Replace dialog box, select Regular expressions.
Enabling Regular expressions disables the Skip tags while searching option.
- If replacing text in a project or folder, select Make Backups and specify a backup location. If replacing in the current document or in all open documents, consider making backup copies before proceeding.
- In the Find what box, type the regular expression for the pattern you want to find.
For more information, see "Using Regular Expressions".
- Complete the rest of the search dialog box as you would in any extended search.
For help, see "Using extended search commands".
- Click the Find or Replace button, as applicable.
Copyright © 2001, Macromedia Inc. All rights reserved. |
|
Comments