set textStorage to textView's textStorage()
-- append new text
set newTextLength to textStorage's |length|() as integer
set oldText to "Count of recognizable Job attachments is : 0"
set newText to "Count of recognizable Job attachments is : " & actualPrintableJobsAttachmentcounter
set p to 1
tell textStorage to replaceOccurrencesOfString_withString_options_range_(oldText, newText, 1 as integer, {newTextLength - 400, newTextLength - 100})
set p to 2
set newTextLength to textStorage's |length|() as integer
tell textStorage to replaceCharactersInRange_withString_({newTextLength - 196, 66}, theText)