Create Internal Scripts in Visual Studio

Since CM4D does not have any debugging tools built in, you may develop and debug the scripts in another application, such as Visual Studio or Excel, before migrating it into CM4D.

Microsoft Visual Studio not only gives you convenient tools for writing code, such as IntelliSense, but it also provides debugging capabilities that are not available in the current CM4D scripting engine.

To create internal scripts using Visual Studio:

1.     Open Visual Studio and create a C# Console Application.

2.     Add references for the CM4D COM Component and for the CM4D.Scripting .NET Assemby.

3.     Add a class called CM4DScript.

4.     Set up the CM4DScript class. Make sure to add the using statement.

5.     Create the Execute function, matching what you see in the CM4D Scripting.

6.     Configure Main. Make sure to add the using statement.

a.     Initialize QaDoc.

b.     Create CM4DScriptingDoc and initialize it by setting up the Doc property.

c.      Create a new CM4DScript.

d.     Call execute and test out your script.

7.     When you are satisfied, copy the code to CM4D's internal scripting dialog.

8.     Run it in CM4D.