Hello,
i want to structurize a document (rtf,txt) with tags (to insert before of a particular text-attribute), whenever the script finds: bold, italic, UPPERCASE, punctuation (, ; . . - ( ) to apply for the entire paragraph in a document. (and to extend for the entire document)
There exists no entry for these attiributes in the applescript dictionary! help!
How can i do in my case?? using some special applications?
set vol_0 to "[[volm 1]]"
set sil_1 to "[[slnc 150]]" -- ', ' , ' (' , '. ',
--set sil_2 to "[[slnc 250]]" --'--','-'
set sil_3 to "[[slnc 500]]" --1 or more empty paragraphs
--set vol_1 to "[[volm 1.5]]" --italic
set vol_2 to "[[volm 2]]" --bold
--set vol_3 to "[[volm 3]]" --title
set the_chars to {",", "(", "-", ":", "¢", "."}
--set bold_y to {}
set title_y to {40}
--set allpara to every paragraph of document 1
tell application "TextEdit"
--tell application "Journler"
--set E to first item of (get selected entries)
set E to document 1
--set hh to name of E
--set this_para to every paragraph of E
set paragraph 1 of E to (vol_2 & return & first paragraph of E & return & vol_0 & return as text)
repeat with I from 0 to count paragraphs of E -- of document 1
set this_para to paragraph I of E -- of document 1
if this_para is not "\n" then
repeat with ah from 1 to count characters of this_para
set this_char to character ah of this_para
if this_char is in the_chars then
set character ah of paragraph I of E to ¬
(this_char & sil_1 as string)
exit repeat
end if
end repeat
repeat with x from 1 to count words of this_para
set this_w to word x of this_para
--set this_w to this_w as rich text
try
set the_sz to size of (character 1 of word x of paragraph I of E)
if the_sz > 14 and the_sz is in title_y then
set this_para to vol_2 & this_para & return & vol_0
set cc to count words
exit repeat
end if
end try
end repeat
else if this_para is "\n" then
set this_para to (sil_3 as text)
end if
end repeat
set the last paragraph of E to (last paragraph of E & return & sil_1 & return & sil_3 & return & vol_2 & return & vol_0 as text)
--set thePP to path of document 1
set thecont to every paragraph of document 1 as text
set the clipboard to thecont
tell application "GhostReader" to activate
end tell