-- Here's An Example of What I believe to be
-- what you are looking for:
global theHTML, theTitle, htmlBC, htmlT, htmlL, htmlV, theBODY, theFileSpec
set theTitle to displayD("HTML <TITLE>:", "Your Title Here")
set htmlBC to displayD("1/5: HTML <BODY BGCOLOR>:", "BLACK")
set htmlT to displayD("2/5: HTML <BODY TEXT>:", "WHITE")
set htmlL to displayD("3/5: HTML <BODY LINK>", "WHITE")
set htmlA to displayD("4/5: HTML <BODY ALINK>:", "WHITE")
set htmlV to displayD("5/5: HTML <BODY VLINK>:", "WHITE")
set theBODY to displayD("HTML Content:", return & return & return & return & return & return & return & return & return & return & return & return & return & return)
set theHTML to "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">" & "<HTML>" & "<HEAD>" & "<TITLE>" & theTitle & "</TITLE>" & "</HEAD>" & "<BODY BGCOLOR=\"" & htmlBC & "\" TEXT=\"" & htmlT & "\" LINK=\"" & htmlL & "\" ALINK=\"" & htmlA & "\" VLINK=\"" & htmlV & "\">" & "<H2>" & theTitle & "</H2><BR>" & theBODY & "</BODY></HTML>"
try
try
set theFileSpec to (new file with prompt "Name The New HTML File" default name "interactive.html")
on error
return
end try
error "t"
--return theFileSpec
set x to (open for access theFileSpec with write permission) --theFileSpec)
write theHTML to x
close access x
on error err number num
close access x
display dialog "An Error Has Occured:" & return & return & err & tab & num & return & "Script Was Aborted." buttons "OK" default button 1 with icon 0
return err & tab & num
end try
on displayD(question, answer)
set theResult to text returned of (display dialog question default answer answer buttons {"Cancel", "OK"} default button 2)
return theResult as text
end displayD
-- In AppleScript a " is a Special character, for one to include
-- a " in a string in AppleScript one must first prefix the Quote (")
-- with a back slash like so:
-- \"
-- much as some words are reserved words to AppleScript
-- such is
beep to utilize
beep as a variable name
-- one must prefix & append a bar ( | ) to the reserved name like so:
-- |beep|
-- then the variable may be called as |beep|, this is useful
-- for some Scripters who would prefer to have clear verbose scripts.
-- hope this helps
------------------
-- An idea is salvation by imagination.
-- Frank Lloyd Wright
-- 30 --