Applescript for Mac Office 2008 Help!

Hello, I’m totally new to Mac Office and scripts…

This is my question:

For my job as a proofreader of business documents, I need to change the text colour from black to red (and also to blue and strikethrough) whenever I correct the grammar/spelling etc so that the client knows where they have gone wrong. In Office 2007 I just recorded a Macro for each colour so that I could just highlight the text and use a quick keyboard action for each colour of text I needed (eg ctrl + r = red text).

But Mac Office 2008 does not have Macros… I assume (and hope!) that I can set up Applescript to do the same job but I’ve been searching the internet for tutorials and forums on this topic and cannot find anything. It seems like such a simple task but I just can’t do it.

Would anyone be able to help me with this? It’s quite urgent and seriously I will buy you flowers/chocolates/beer if you can help! What I need is script for the task of changing highlighed text colour to red (and blue and strikethrough) when I use a keystroke (eg ‘cmd’ + ‘r’ for red text) and any other tips on how to make it work.

Looking forward to hearing from you, please let me know if you need more info from me.

Becky Hunter.

Give this a try make a script for each color you want to use that looks like this

tell application "Microsoft Word"
	tell selection
		--options are dark red, red, orange, yellow, light green, green, light blue, blue, dark blue, dark purple
		set color index of font object to red
	end tell
end tell

Name each script whatever you want, probably like “Change ” and save it in Documents/Microsoft User Data/Word Script Menu Items folder located INSIDE your home folder. Now when you have a document open and you select text you can go to the scripts menu in word and select the appropriate color change.

To take it a step forward though you can utilize keyboard shortcuts based on how you NAME each script file. To define a shortcut for a script in word put backslash "" at the end of the name and then one or more modifiers.

The modifiers are.

m Command
c Control
o Option
s Shift

So if you wanted to make the shortcut for Red be Command-r then you would name the file like this “Change to Red\mR.scpt”

Give it a try and let us know how it goes!

P.S. After putting in a new script I would recommend restarting Word though I don’t know if technically its required.

P.S.P.S. To change to Blue AND do a strikethrough would be like this

tell application "Microsoft Word"
	tell selection
		--options are dark red, red, orange, yellow, light green, green, light blue, blue, dark blue, dark purple
		set color index of font object to blue
		set strike through of font object to true
	end tell
end tell

Hope this all helps!