Remove html code from file

I'm trying to figure out how to remove all the html code from a file.

I've got an AppleScript but it doesn't remove all the code

<code>
on run {}
copy (choose file with prompt "Remove markup from which file:") to the_file
prompt user(thefile)
end run

on open (the_file)
if length of the_file > 1 then
display dialog "Please drop only one file on me at a time."
else
prompt user(thefile)
end if
end open

on prompt user(afile)
copy (read a_file) to message_text
copy (open for access file ((path to desktop as text) & "Markup Removed") with write permission) to new fileID
write remove markup(messagetext) starting at eof to new fileID
close access new fileID
end prompt_user

on remove markup(thistext)
set copy_flag to true
set the clean_text to ""
repeat with this_char in this_text
set this_char to the contents of this_char
if this_char is "<" then
set the copy_flag to true
else if the copy_flag is true then
set the clean_text to the clean_text & this_char as string
end if
end repeat
return the clean_text
end remove_markup
</code>

Posted on Jun 7, 2006 4:01 AM

Reply
3 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Remove html code from file

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.