Scripts no longer working in Mavericks?

Hi all,

I tried opening some scripts I made a few years ago, but it seems a lot has changed under more recent Mac OSX versions?

For example, this part is not working anymore - Applescript returns something like “expected Rule End, but found Class Name” (translated from dutch…), while marking the word “document” in the second line…

tell application "Microsoft Word"
	
	activate
	
	set bestekDoc to active document
	-- einde van document definiëren
	set documentEnd to end key selection move unit a story extend by moving
	-- nieuwe TOC toevoegen aan einde van document
	make new table of contents at active document with properties {include page numbers:false, text object:documentEnd, use fields:false, use heading styles:true, lower heading level:3, upper heading level:1}
	-- | vervangen door tabs
	set tocRange to create range active document start (start of content of text object of table of contents 2 of active document) end (end of content of text object of table of contents 2 of active document) --TOC als tekst-range instellen
	
	execute find find object of tocRange find text "| " replace with "^t" replace replace all
	execute find find object of tocRange find text "^w|" replace with "^t^t^t^t^t^t^t" replace replace all -- zorgt ervoor dat er genoeg lege cellen zijn tussen omschrijving en meetcode
	execute find find object of tocRange find text "|" replace with "^t" replace replace all
	select tocRange
	copy object selection
	set the clipboard to (the clipboard as Unicode text)
	
end tell

Did I miss out on some “massive” change?

Thanks for any help!

Model: MacBook Pro Retina
AppleScript: Unclear…
Browser: Safari 537.85.10
Operating System: Mac OS X (10.8)

Maybe Microsoft Word changed. Is “active document” still a property? (Check the dictionary)

First of all welcome!

Just checking to make sure: Do you have an emulator running Windows installed as well? There is a known issue that you compile properly but the event is send to parallels instead. You can bypass this issue by sending the event to the application by bundle identifier instead of by name.

tell application id "com.microsoft.word"
--do your things in word
end tell

BTW: Your script works on my 10.8 machine, haven’t tested it on Mavericks.

Update: Active document works in Mavericks as well using Word 2011.

Thx for pointing that out DJ Bazzie-Wazzie!

I have parallels running - that will be it - have to check it out. I will come back here to post the results!