AppleScript - Expected end of line etc. But found classname (-2741) when building the solution

Hello,


I am new to Mac application development and our existing Mac application contains an AppleScript that handles all the Microsoft Word operations. When i build the solution via XCode in Catalina MacOS that do not have Microsoft Word installed in it, it is throwing a build error as "Expected end of line etc. But found classname (-2741)" .


The error is thrown exactly in the line of code shown below



When i build the same solution in Mojave MacOS that has Microsoft Installed in it then it is working fine without any build errorsand the build is getting succeeded.

Can you please suggest on how to handle the AppleScript such that the solution gets build without any errors irrespective of Microsoft Word installed or not? This is of high priority and needs to be fixed at the earliest.


Thanks and Regards,

Kamal

MacBook

Posted on Jul 13, 2020 4:35 AM

Reply
3 replies

Jul 13, 2020 6:10 AM in response to Kamal1404

The MS Word application bundle includes the scripting definitions that reconcile your Word-specific AppleScript syntax. You should also be aware that without warning, Microsoft could alter the syntax in the Word scripting dictionary definitions, and your AppleScript would break for that reason too. So, yes, the correct version of MS Word that satisfies your Word-specific AppleScript must be installed.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

AppleScript - Expected end of line etc. But found classname (-2741) when building the solution

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.