Thanks to syntax in a script by Hans Hafner, I am beginning to set up a clean-up script for Word documents sent to me for web posting. I was able to strip double-returns, tabs, swap n-dashes for em-dashes, strip multiple word spaces, set space after paragraphs and fix indents. However, I am running into what must be a very obvious wall when I try to change type size or font in Word copy.
I have tried
set text font size to 12
addressing the text range, the paragraph, the active document, document 1, etc. and have not yet hit on the magic combination that actually makes a change. I have also tried variations on the somewhat arcane
execute find find object of _range find text font size 14 replace with text font size 12 replace replace all
The other problem I’m having is conditional formatting based on content. I can’t seem to set one set of paragraph parameters based on whether or not a newline character is in the paragraph. I have tried AppleScript’s formatting (\n) and Word’s formatting (^l) but neither seems to be detected. I hate to say it, but this was a piece of cake in Quark, and seems impossible in Word. (I suspect I have no clear picture of Word Applescript syntax or scope … that was often the case when I hit a Quark wall.)
Has anyone had any success with the bloated Word dictionary, or can offer up some script snips of syntax?
I appreciate any help anyone can offer. I’ve done a fair amount of Quark scripting, and this brings back the hours of head-banging I went through until I discovered or was handed the proper syntax. The whole style of dictionary usage seems very unusual.
Thanks
George Mack