home *** CD-ROM | disk | FTP | other *** search
- property browserpath, filepath, htmltext, fieldname
- global gBrowser
-
- on new me, srcfield
- set browserpath to "MacAddict:Essentials:MSIE:Internet Explorer 2.1"
- set filepath to getOSDirectory() & "\imagine.html"
- set fieldname to srcfield
- set gBrowser to me
- return me
- end
-
- on load me, myfieldname
- set htmltext to the text of member myfieldname
- assign(me, "#date", the long date)
- assign(me, "#time", the long time)
- end
-
- on assign me, searchstr, replacestr
- set pos to offset(searchstr, htmltext)
- repeat while pos > 0
- put replacestr into char pos to pos + length(searchstr) - 1 of htmltext
- set pos to offset(searchstr, htmltext)
- end repeat
- end
-
- on launchURL me, url
- load(me, fieldname)
- assign(me, "#url", url)
- output(me)
- open(filepath, browserpath)
- end
-
- on output me
- set file to new(xtra("FileIO"))
- createFile(file, filepath)
- if error(file, status(file)) = "File already exists" then
- openFile(file, filepath, 2)
- delete(file)
- put error(file, status(file))
- createFile(file, filepath)
- put error(file, status(file))
- end if
- openFile(file, filepath, 2)
- put error(file, status(file))
- writeString(file, htmltext)
- put error(file, status(file))
- closeFile(file)
- put error(file, status(file))
- end
-