Applescript: Tuning comment' content in MS Word
Hello,
I am trying to add comments into MS Word document with Applescript.
I can inser tcomment itself with deriverd from this forum sentence:
makenewWord commentatselectionwith properties {comment text:"review this"}
Then I need to change color of text in this comment. The obvious way is to get reference to this freshly created comment, extract
get comment text property as text object and set up font properties to that object.
But I cannot figure how to get reference to this comment. I tried:
set anchor to makenewWord commentatselectionwith properties {comment text:"review this"}
and anchor is set to:
Word comment 1 of text range id «data iWrg1E0300001E030000» of document "Документ2"
but i got:
get properties of anchor
--> missing value
Then I tried:
set curText to get properties of selection
but it returns no mention of the Word Comment element :-(
get properties of selection
--> {class:selection object, content:"T", formatted text:formatted text of selection, selection start:807, selection end:807, font object:font object of selection, selection type:selection ip, story type:main text story, style:Word style "Обычный" of selection, footnote options:footnote options of selection, endnote options:endnote options of selection, show Word comments by:"All Reviewers", border options:border options of selection, shading:shading of selection, paragraph format:paragraph format of selection, page setup:page setup of selection, show hidden bookmarks:false, story length:888, language ID:russian, language ID east asian:russian, supplemental language ID:russian, column options:missing value, row options:missing value, header footer object:missing value, is end of row mark:false, bookmark id:0, previous bookmark id:0, find object:findid «data iWio68E00A7C» of selection, text object:text object of selection, selection flags:selection active and replace, active:true, start is active:false, IP at end of line:false, extend mode:false, column select mode:false, orientation:text orientation horizontal, document:document of selection, no proofing:false, fit text width:0.0, range footnote options:range footnote options of selection, range endnote options:range endnote options of selection}
At the same time:
get every Word comment of document "Документ2"
--> {Word comment 1 of document "Документ2"}
My question is - how to get reference to the Word Comment object created in my Applescript? I cannot use list with all comments (last fragment) because I don't know where exctly my last command is in this list. I cannot distinguish it by texts, because several comments can contain the same "words" but should be of different colors.
Regards,
Vladimir
iMac, Mac OS X (10.7.2), WorkHorse