MS Word

Hi All,
I was wondering if anyone has figured out a way to make a script that when executed, it will

  1. Open Word
  2. Create new Word Notebook
  3. Create the header (specified by user)
  4. Save as (specified by user)
  5. Save to… (on disk (Default “Documents”))

This script is for me for class so I can just run the script and boom… Done…

Any help would be greatly appriciated.

Chris D.

P.S. - I don’t think MS Word:Mac has a AppleScript Library so I think I may have to emulate the key presses… Shit…

Model: MacBook
AppleScript: 2.11
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

Hi Chris,

No Sir, MS Word has a hugh AppleScript dictionary.
I hope, you’re talking about Office 2004 not Office v.X because AFAIK only 2004 has the NoteBook option

I really hate Word, because it crashed so often while Script Debugger tries to read some properties :(:frowning:

This script is certainly not perfect (I gave up to improve it after the 20th crash of Word) but it should work

set theTitle to text returned of (display dialog "Enter title" default answer "")
set ct to count theTitle
tell application "Microsoft Word"
	-- make new document
	set view type of view of active window to WordNote view
	set x to text object of (get header section 1 of active document index header footer first page)
	set content of x to theTitle & text 1 thru -2 of (get content of x)
	tell font object of x to set {name, font size} to {"Verdana", 12}
	repeat with i from 1 to ct
		tell font object of character i of x to set font size to 18
	end repeat
	save active document in path to documents folder
end tell

PS: Here is the AppleScript Reference for Office 2004