Get url "file:///..."
hh at hh.on-rev.com
Tue Jun 21 19:33:01 CEST 2016
the task of Jim is, as I understand, that he wants a correct
actual browser interpretation of the file, that is, what Safari
displays, some say HTMLtoTEXT to such a conversion.
LC's status for 'the htmltext' is HTML of before 2005 ...
The applescript is probably instable because of delayed result
sending/ getting but it's the most actual interpretation you can have.
Now I just looked into my treasure chest for MacOS and found the
following. I tested once for 50 files. Worked stable and very fast.
(This is the conversion method that TextEdit uses).
-- Convert files on MacOS, tested on 10.11/ 10.12
-- Outputs to an input-file with the ending changed to format
-- "textutil -convert format <inputfile.format>
-- format is one of the following
-- txt, html or htm, rtf, rtfd, doc, docx, wordml, odt, webarchive
set defaultfolder to \
put the files into fs
-- filter fs with/without some criterium
repeat for each line f in fs
put shell("textutil -convert txt " & f) into nirwana
If you have all files and only these in one folder you could simply use:
(all files converted by one line, you could do that also in Terminal).
put "/Users/jimhurley/Library/Mail Downloads/elec_web/precincts/" into f0
-- assuming all files to convert end in "htm"
put shell("textutil -convert txt " & f0&"*.htm") into nirwana
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Get-url-file-tp4705988p4706032.html
Sent from the Revolution - User mailing list archive at Nabble.com.
More information about the use-livecode