Here’s the final script I’ve been using. Works really well, have done thousands of records with no problems. If anyone has any ideas to do this better, let me know!
I added a check so that records without addresses from Yahoo! would not be added to the database and a check to make sure duplicates weren’t entered by using Filemaker-side scripts to do quick Finds, whose results load global FileMaker variables that AppleScript can check against. Works great, decently fast.
Made extensive use of BBEdit’s ability to switch between literal and GREP searches, which allowed me to “drill down” into various removals of sets of HTML code and excess fluff that gets in the way of pulling the data. Probably could break this code into sub-handlers, but was just lazy and needed to get this project done ASAP. 
To use script:
–Select an area in Yahoo! Yellow pages to search
–Do a search, drill into a category as needed.
–Switch from “Sponsored Businesses” to “Distance”
–run script
–click “next” link in Yahoo! YP
–run script again, and so on
If anyone wants details on the FileMaker side of things, let me know.
tell application "Safari"
set pageHTML to source of document 1
end tell
tell application "BBEdit"
activate
make new text window with properties {contents:pageHTML}
--strip HTML Markup
replace "<[^<>]*>" using "" searching in text 1 of window 1 options {search mode:grep, starting at top:true}
--fix carriage returns
replace "
" using "
" searching in text 1 of window 1 options {search mode:grep, starting at top:true}
--fix special characters
replace " " using "" searching in text 1 of window 1 options {search mode:literal, starting at top:true}
--remove non-data top and bottom stuff
find "Miles**" searching in text 1 of window 1 options {search mode:literal, starting at top:true} with selecting match
set selectionOffset to (offset of selection) + 7
select characters 1 thru selectionOffset of text window 1
delete selection
find "** Distances" searching in text 1 of window 1 options {search mode:literal, starting at top:true} with selecting match
set selectionOffset to (offset of selection) - 12
select characters selectionOffset thru -1 of text window 1
delete selection
--strip superfluous space, tabs, and other artifacts and useless data to standardize data "records"
replace "Map" using "" searching in text 1 of window 1 options {search mode:literal, starting at top:true}
replace "See reviews on Local
" using "" searching in text 1 of window 1 options {search mode:literal, starting at top:true}
replace "Web Site" using "" searching in text 1 of window 1 options {search mode:literal, starting at top:true}
replace " " using "" searching in text 1 of window 1 options {search mode:literal, starting at top:true}
replace " " using "" searching in text 1 of window 1 options {search mode:literal, starting at top:true}
replace "
" using "" searching in text 1 of window 1 options {search mode:literal, starting at top:true}
replace "^\\(.*
" using "" searching in text 1 of window 1 options {search mode:grep, starting at top:true}
replace "
" using "" searching in text 1 of window 1 options {search mode:literal, starting at top:true}
replace ", CA" using "" searching in text 1 of window 1 options {search mode:literal, starting at top:true}
replace "
[0-9]*\\.[0-9]*
" using "" searching in text 1 of window 1 options {search mode:grep, starting at top:true}
end tell
tell application "BBEdit"
activate
--get addresses from file
repeat with addressNumber from 1 to 20
tell text window 1
set addressBlockLineStart to ((addressNumber - 1) * 7) - (addressNumber - 2)
select insertion point before line addressBlockLineStart
set lineBeginOffset to offset of selection
select insertion point after line addressBlockLineStart
set lineEndOffset to (offset of selection) - 1
set companyName to (characters lineBeginOffset thru lineEndOffset) as text
select insertion point before line (addressBlockLineStart + 1)
set lineBeginOffset to offset of selection
select insertion point after line (addressBlockLineStart + 1)
set lineEndOffset to (offset of selection) - 1
set companyAddress to (characters lineBeginOffset thru lineEndOffset) as text
select insertion point before line (addressBlockLineStart + 2)
set lineBeginOffset to offset of selection
select insertion point after line (addressBlockLineStart + 2)
set lineEndOffset to (offset of selection) - 1
set companyCity to (characters lineBeginOffset thru lineEndOffset) as text
end tell
tell application "FileMaker Pro 8"
activate
open file "OSXT:Users:kquosig:Desktop:Print Shops, 070601.fp7"
--check for duplicate address
if companyAddress is not "" or "
" then
set cell "g_Address_Search" of current record to "\"" & companyAddress & "\""
do script "Duplicate Pre-Check"
if cell "g_IsDupe" of current record is "no" then
set newRecord to create new record
set cell "Company" of newRecord to companyName
set cell "Street Address" of newRecord to companyAddress
set cell "City" of newRecord to companyCity
end if
end if
end tell
end repeat
end tell
tell application "BBEdit"
close window 1 without saving
end tell
tell application "FileMaker Pro 8"
close document 1
end tell