Thank you very much Rich.
If I understand correctly, in order to call some of the commands from the Microsoft Word applescript dictionary (such as page scroll), I need to do the following:
- Create a applescript and place it in ~/Library/Application\ Scripts/com.microsoft.Word Here is where I would have 1 of the scripts that I posted in the initial question.
- Create a new macro within Word that calls that specific script using AppleScriptTask such as the following:
Sub hello()
Dim myScriptResult
As String
myScriptResult = AppleScriptTask("pagescroll.scpt", "myapplescripthandler", "my parameter string")
End Sub
Now, I should be able to in principle call this macro within Word and it should just work...
However, when calling with the following applescript:
on myapplescripthandler(paramString)
#do something with paramString
tell
application "Microsoft Word"
to page scroll
down 1
display notification
paramString
return "You told me " &
paramString
end myapplescripthandler
I get the following error in the image attached:
If I remove the page scroll command, then I can successfully get the notification to show up. Otherwise, I get the previous error.
Any suggestions?
Thanks in advance,
Harold