Applescripting Track Changes and the Document Background

U

Uniquark

Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hi,
  I generally edit with track changes on and the changes hidden. This means that I don't notice when I forget to turn tracking back on and I might edit 10 or 20 pages before I realize that I'm not tracking. Therefore, I would like to create a flag that will clearly indicate that tracking is on or off, the little button at the bottom of the screen is not enough. I think changing the background of the document would be enough. I've put together an applescript that works perfectly except for two small problems. Here's the script.

tell application "Microsoft Word"
        set theDoc to get active document
        set thebackground to get background shape of theDoc
        set bgFill to get fill format of thebackground
        set boolTracking to get track revisions of theDoc
        if boolTracking then
                set fore color of bgFill to {255, 255, 255}
                set visible of bgFill to false
                set track revisions of theDoc to false
        else
                set fore color of bgFill to {230, 224, 217}
                set visible of bgFill to true
                set track revisions of theDoc to true
        end if
        set test to get transparency of bgFill
end tell

The first problem I'm having with this script is that it does not change the background color in each document until I have changed it manually once. Clearly, the background dialog (Format->Background) is setting some other flag that I don't know about. Can anyone point me in the right direction?

The second problem is that revision tracking is spotty right after I fire this script for the first time. Sometimes the blue button at the bottom of the window lights up and sometimes it does not. Regardless of whether that button lights up, new text entered may or may not be tracked. Moving the focus away from that window and back or even just moving the window seems to fix the problem. What do I need to do to cleanly and reliably turn tracking on?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top