Searching in Scripts
You can do two types of searches of script file contents when the script file is open in the text editor
NOTE:
- Both the Find and the Find and replace dialog boxes can remain open while you work in the script.
- You can automatically populate the Find field by selecting text in the script before you open either the Find or the Find and replace dialog boxes.
To find a text string in an active script tab:
-
Ensure the script is the active tab.
-
Select Edit > Find.
The Find dialog box opens.
TIP: If the command shortcut underlines are not visible, press Alt.
-
Enter a text string in the Find field, choose options, and click the appropriate button.
-
Options:
- Match case—Matches capitalization
- Match whole word—Matches entire words
- Regex—Matches based on a regular expression entered
- Buttons:
-
Find next—Finds the next occurrence of the string
-
Find previous—Finds the previous occurrence of the string
-
Mark All—Highlights all occurrence of the string
NOTE: You can clear the marks in the script by clicking View > Mark Text > Clear Marks.
-
Close—Closes the Find dialog box
-
-
-
Make any adjustments to the found string in the script.
-
Click Close if finished or continue searching.
To find and replace a text string in an active script tab:
-
Ensure the script is open in the text editor in the active tab.
-
Select Edit > Find & Replace.
The Find and replace dialog box opens.
TIP: If the command shortcut underlines are not visible, press Alt.
-
Enter text in both the Find and Replace boxes.
-
Choose options and click the appropriate button.
-
Options:
- Match case—Matches capitalization
- Match whole word—Matches entire words
- Regex—Matches based on a regular expression entered
- Replace All in Selection—Limits the Replace all button to replace all occurrences in the selected region of the script
-
Buttons:
- Find next—Finds the next occurrence of the string
- Replace—Replaces the text in the selected string
- Replace all—Replaces all occurrences of the string in the entire script unless a region of the script is selected and the Replace All in Selection box is selected
- Close—Closes the Find and replace dialog box
-
-
Click Close if finished or continue searching.
The
TIP: If the command shortcut underlines are not visible, press Alt.
In the Advanced section, there are options to narrow the search:
-
Specific tasks—Search the selected tasks. Select one or more tasks from the list. Defaults to the active task.
-
Specific object types—Search specific object types. Select one or more object types from the list.
-
Specific objects—Search specific objects within the script. Select one or more objects from the list.
-
Specific properties—Search specific properties within the script objects. Select one or more properties from the list.
In the search results, details are given as to the location of where the search string is found. You can right-click an item in the Object column and select Go to Object to see where the item was found.
You can also deselect items where you do not want to do the replace action.