I am currently adding text to an html template, writing text in textEdit. It’s rather laborious to add in
tags around every paragraph, even with a shortcut in Dreamweaver.I have started to fiddle with an AppleScript to run on the front document in textEdit but AppleScript seems to handle paragraphs via returns or line breaks, not the actual paragraph itself.
For example, this script run on the following text returns 9, not 5 as expected:
tell application “TextEdit”
set myParas to count paragraphs of front document
end tell
display dialog myParas
"AN UNEXPECTED PARTY
In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down
on or to eat: it was a hobbit-hole, and that means comfort.It had a perfectly round door like a porthole, painted green, with a shiny yellow brass knob in the exact middle.
The door opened on to a tube-shaped hall like a tunnel: a very comfortable tunnel without smoke, with panelled walls, and floors tiled and carpeted, provided with polished chairs,
and lots and lots of pegs for hats and coats—the hobbit was fond of visitors."
So is adding in a
tag at the beginning of each paragraph and a
at the end going to be a frustrating exercise in counting line breaks or is there an easier way to do this?