home *** CD-ROM | disk | FTP | other *** search
- property browserpath, filepath, htmltext, FieldName
- global gBrowser
-
- on new me, srcfield
- set browserpath to field "browserSelect"
- 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
- loadBrowser()
- 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))
- openFile(file, filepath, 2)
- setFinderInfo(file, "TEXT ttxt")
- closeFile(file)
- end
-
- on NoBrowserU
- alert("You must select a Web Browser to link to this information. Please select one now.")
- openconfigwindow()
- end
-
- on LaunchIt
- puppetSound(2, 0)
- puppetSound(2, "LaunchingWeb")
- delay(400)
- set weburl to field "url"
- launchURL(the text of field "browserloc", weburl)
- end
-
- on loadBrowser
- global myfile
- set myfile to new(xtra("fileio"))
- set finalPath to field "OSPath"
- openFile(myfile, finalPath & "Browser.txt", 1)
- set TheWeb to readLine(myfile)
- put TheWeb into field "browserLoc"
- closeFile(myfile)
- set myfile to 0
- browserName(the text of field "browserloc")
- browserName(#enabled, 1)
- end
-