I started off by recording this script using Script Debugger using copy and 
paste. Then I switched to using variables.


tell application "BBEdit"
    activate
    make new text document with properties {contents:current clipboard}
-- raw text from email
    apply text factory file "iMac HD:Users:account:Library:Application 
Support:BBEdit:Text Filters:chogdayreport.textfactory" to text 1 of text 
document 1 saving no
-- text factory formats text to HTML
    set t to text 1 of project window 1
-- t set to HTML
    select text document 1 of project window "index.html"
    select insertion point before character 1 of document 1
    set bounds of project window 1 to {320, 125, 1674, 1399}
    set a to text 1 of project window "index.html"
-- display dialog (a) shows correct text except when using BBEdit script 
menu
-- get the offset of insertion placeholder
    set o to offset of "<!--insert-->" in a
    set characters o thru (o + 12) of document 1 to t
-- replace selection with HTML text
--BBEdit put the text in the correct place except that the text is corrupted
end tell

I am not using grep replace.


-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.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 [email protected].
To post to this group, send email to [email protected].

Reply via email to