Here’s a cool trick I picked up in Dreamweaver (DW8 but probably works in many versions). Often I need to copy-n-paste the same code into many pages, but not all of the pages in a site (e.g. only the pages about a certain place or subject). Instead of opening all of those pages and pasting the needed code try using Dreamweaver’s Find/Replace function and have it perform the replacement only on the documents you have open.
- Get the code you need
- Close all pages in Dreamweaver you do not need to edit, and open only the pages you need to paste your code into
- Press CTRL+F (Command+F1 on Mac OS) and in the Find and Replace dialogue box, in the Find in dropdown box (screenshot below) select Open Documents
- Now enter the code you need in the Find and Replace boxes then click the Replace All button (see notes below). Optionally you can click Replace instead to watch the replacement happen page-by-page until you feel safe enough to click the Replace All button.
– Its a good idea to save the changes you make only to one page first, then upload it to make sure it looks the way you want. If it doesn’t then you still have all of the pages open and you can undo or make the changes anew. If it looks okay then you can do a Save All.
– If you are not editing too many documents and you use the Replace All button, you can use the undo feature to undo your changes if a) you don’t mind doing it for each page you’ve just changed and b) your settings allow that many levels of undo
– Dreamweaver is very good at doing what you ask, so as with any program make sure you ask it to do exactly what you want. Make sure the Find box contains code that is unique enough to only make changes where you want them.