PDA

View Full Version : Help to convert MS Word VBA to Applescript




obelixander
Sep 15, 2010, 06:45 PM
I have the following procedure written in VBA for Word which I need to use in Word 2008 for Mac. Please bear with me as I've had a very basic first stab and know very little about Apple Script.

Sub descriptionRelativeMacro()

If Selection.Type = wdSelectionNormal Then

ActiveDocument.Indexes.MarkEntry Range:=Selection.Range, _

Entry:="D:" & Selection.Range.Text & "/" & Time() & "/-PPP/R/"

End If

End Sub

I've started to try and write that in Apple Script by writing this:

if selection type of selection is selection normal then mark for index active document range text object of selection ¬
entry "D:" & content of text object of selection & "/" & (current date) & "/-PPP/R/"
end if

but I get the following error message:

"Expected “then”, etc. but found identifier."

Can you help?

Many thanks.