DanBrill Posted April 21, 2003 Posted April 21, 2003 Hi, I have a text field that I'd like to turn into an html document. What's the best way to do this with a script? Thanks, Dan
cjaeger Posted April 22, 2003 Posted April 22, 2003 Best way: use xml export and xsl stylesheet. Easier way: make a calcfield ("<HTML><TITLE>" &External(WebToHMTL; title) & "</TITLE><BODY>" & External(WebToHMTL; bodytext) & "</BODY></HTML>", export this field as tab-delimited text as C:tempexport.html or Macintosh HD:temp:export.html. Then rename this file with applescript, a WSH-Script or a Windows batch file.
DanBrill Posted April 22, 2003 Author Posted April 22, 2003 Thanks for the suggestions, cjaeger, but I can't seem to get this to work. I don't think I was being clear enough. I don't have a text field that I want to have appear in an HTML page. What I have is a text field that is already raw html code (with a bunch of javascript thrown in for good measure). If I simply copy the field contents, paste them into a text file, and save it with a .htm extension, then it runs fine from a browser window. But if I try to export the field contents, saving it as a tab-delimited text file with an .htm extension, it doesn't work. None of the line breaks in the code come out right, and it gets pretty wonky in general. I'd like to use the xml export to accomplish this. Where can I get a style sheet? If I can't do that, can I still use the calcfield method? Am I missing something? Thanks, Dan
cjaeger Posted April 22, 2003 Posted April 22, 2003 try an export calc field =replace(Html_field;"q|";"") and export it. This will strip any "q|" (return) characters from the file. They are not needed by the browser to display HTML (though they might be needed for some javascripts). just give it a try. or see this thread (and my attachment there) http://www.fmforums.com/threads/showflat.php?Cat=&Board=UBB28&Number=64233
Recommended Posts
This topic is 7887 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now