# Fetching Information From The Web

Tinderbox offers several ways to fetch information from a Web page.

- You can create a note whose text is the contents of a Web page you designate. Tinderbox can automatically fetch the contents of that Web page, so that the note is always updated with the current contents of that Web location.
- You can have notes that open automatically in a Web browser.

### Attributes for Working With the Web

#### URL

$URL lets you associate a URL with a note. Other attributes use this URL to fetch data.

Examples:

> `http://www.eastgate.com`

> `mailto:info@eastgate.com`

If URL is a key attribute, a globe icon appears next to the URL. Press the globe to view the URL in your preferred Web browser.

#### AutoFetch

If `$AutoFetch` is true, the note will attempt to download text from the URL specified in $URL. If no URL is specified, or if the URL cannot be reached, or if Tinderbox cannot open an internet connection, AutoFetch has no effect.

#### AutoFetchCommand

The attribute `$AutoFetchCommand` extends AutoFetch’s capabilities.

AutoFetchCommand is an action that runs when the Tinderbox is ready to fetch information from the Web – when the file is opened, and periodically when the file is open. Typically, AutoFetchCommand will invoke an outside program, perhaps fetching some information from the user's hard disk or network. For example:

> `$Text=runCommand("ls ~Documents")`

will replace the text of the note with a list of all the files currently in the user's Documents folder.

> `$Delivered=runCommand ("myDatabaseQuery "+$TrackingID)`

will run the shell script myDatabaseQuery, passing it the value of the note's TrackingID attribute as an argument.

#### ReadOnly

If `$ReadOnly` is true, you cannot modify the text in this note—you can only view it. It makes sense to set this true for notes that fetch their contents from the Web.

#### LastFetched

`$LastFetched` records the date and time when a note was post recently updated from the Web.