This may be helpful to somebody. I have a text factory that is a chain of 
"Replace All" commands to create an html proof of an xml file. I wanted to 
add the file name to the proof, because it is crucial for correct 
processing of the xml (when it's uploaded to the system in question). 
Here's the Applescript, which is run at the start of the text factory:

on ApplyTextTransform(htmlTitle)
tell application "BBEdit"
activate
set fileName to (name of document 1) as text
set fileCont to (contents of document 1) as text
return ("<html>
<head>
<title>" & fileName & "</title>
</head>
" & fileCont)
end tell
end ApplyTextTransform

Then a grep replace command in the text factory finds the fileName and adds 
it as part of the html body as well. (I realize that the htmlTitle variable 
in the script is superfluous.)

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/1e64603f-4ef6-4c55-b435-a9b7d7db49den%40googlegroups.com.

Reply via email to