# Watched Files

Whisk's Watched Files feature makes sure that the Web Preview is reloaded whenever any files from the page are changed. It automatically creates a list of resources used by the page, and watches your filesystem to see if any changes have been made. When they have, Whisk will reload the page.

This means with Watched Files you can externally edit images, CSS files, JavaScript files, PHP include files, or other embedded data, and refresh the Web Preview automatically when those files are saved.

TIP

If your document's Reload setting in the Options section of the Tools Inspector is set to Manually, watched files will not automatically reload the page. Change to Instantly or Delayed instead.

# Adding Watched Files

Watched Files are located in the File Inspector.

Watch Files
Watch Files

Whisk will automatically monitors resources requested by your HTML page. If it finds a corresponding file on disk, it will automatically be added to the Watched Files.

WARNING

The Mac App Store version of Whisk must have file access permissions for Watched Files to work properly. For more information, see the App Sandboxing chapter of the documentation.

There are many cases where automatic adding will not find a resource that you may wish to be watched for reloads. Most commonly this might be PHP include files, but could also be data files that are requested via XMLHTTPRequests or other dynamic resources. To manually add your own files or folders to watch for changes, either hit the + button and choose them in the Open Panel or drag the files directly into the table view.

# Instantaneous Updates to Files Open in Whisk

Whisk will reload a page's Web Preview if there are changes on disk to a file. There's a special mode that can update even faster: if the file is open in Whisk, then any changes (even unsaved ones) will trigger a reload. Instead of using the on-disk representation, Whisk will use the in-memory representation for the file.

This is especially useful for editing external CSS files; changes you make in the Source Editor will be reflected immediately in the other document's Web Preview.

WARNING

The in-memory representation is only used for assets referenced by the HTML page; PHP resources are not used in this manner.

The Watched Files section in the Inspector provides an Open button to quickly open files in Whisk. If they cannot be edited in Whisk, they will be opened with the file's preferred editor.