Well, one of the so far largely overlooked features of AMS40 is its Macro support. I want to start a thread here for those VBScript gurus out there who want to get involved in extending AMS40's functionality through macros.
All of AMS40's macro support goes through the Macro Editor. To see the Macro Editor, choose Tools > Macros... from the menu. This will open the Macro Editor screen. This is where you will do all of your macro work in AMS40.
AMS40 uses the SAX Basic Engine for its macro support. SAX basic is very close to VBA in nature. It is much more powerful than VBScript, but uses the same syntax. If you have used VBScript or Visual Basic, SAX Basic will be very familiar to you.
If you want to learn more about the language and the macro editor itself, see the Help menu within the macro editor.
AMS40 exposes a very robust COM Automation interface. This means that it exposes its methods and data structures for you to manipulate with Visual Basic, Visual C++, or any other programming tool that supports COM Automation (aka ActiveX). The COM model and all of the methods and properties are outlined in the "COM Automation Reference.doc" document that is located in the Docs subfolder of teh AutoPlay Media Stduio 4.0 folder on your system.
This document along with the SAX language help will be your roadguide to making cool AMS40 macros. Well, enough background for now, let's get into things...
One really useful tool in the macro editor is the object browser. You can open the object browser from the button on the toolbar that looks like a box (to the right of the Print icon). This browser allows you to see all of the classes and functions exposed to the macro editor.
The top-most object that you can manipulate in AMS40 is the Document object. From the Document object you can open, save, build, add pages, remove pages, etc., etc. Basically, all of the top level functionality of AMS40.
For example, one of the properties of the Document is DocumentName. You can use this property to get the name of the currently open document. To see how this works, open the macro editor and paste in the following code:
<pre>
Sub Main
Dim strMsg As String
strMsg = "You are working on document:" + Chr(10) + Chr(13)
strMsg = strMsg + DocumentName
MsgBox strMsg
End Sub
</pre>
Now press the run toolbar button or hit F5 on your keyboard... WOW, the power of it all!!! [img]/ubbthreads/images/icons/smile.gif[/img]
Actually not too exciting, but it is a starting point. In this thread I will provide examples of useful macros that you can use to extend the functionality of AMS40. I also welcome any and all questions, bug reports, etc. about the macro support. I'll be more than happy to try and help out.
- Brett
All of AMS40's macro support goes through the Macro Editor. To see the Macro Editor, choose Tools > Macros... from the menu. This will open the Macro Editor screen. This is where you will do all of your macro work in AMS40.
AMS40 uses the SAX Basic Engine for its macro support. SAX basic is very close to VBA in nature. It is much more powerful than VBScript, but uses the same syntax. If you have used VBScript or Visual Basic, SAX Basic will be very familiar to you.
If you want to learn more about the language and the macro editor itself, see the Help menu within the macro editor.
AMS40 exposes a very robust COM Automation interface. This means that it exposes its methods and data structures for you to manipulate with Visual Basic, Visual C++, or any other programming tool that supports COM Automation (aka ActiveX). The COM model and all of the methods and properties are outlined in the "COM Automation Reference.doc" document that is located in the Docs subfolder of teh AutoPlay Media Stduio 4.0 folder on your system.
This document along with the SAX language help will be your roadguide to making cool AMS40 macros. Well, enough background for now, let's get into things...
One really useful tool in the macro editor is the object browser. You can open the object browser from the button on the toolbar that looks like a box (to the right of the Print icon). This browser allows you to see all of the classes and functions exposed to the macro editor.
The top-most object that you can manipulate in AMS40 is the Document object. From the Document object you can open, save, build, add pages, remove pages, etc., etc. Basically, all of the top level functionality of AMS40.
For example, one of the properties of the Document is DocumentName. You can use this property to get the name of the currently open document. To see how this works, open the macro editor and paste in the following code:
<pre>
Sub Main
Dim strMsg As String
strMsg = "You are working on document:" + Chr(10) + Chr(13)
strMsg = strMsg + DocumentName
MsgBox strMsg
End Sub
</pre>
Now press the run toolbar button or hit F5 on your keyboard... WOW, the power of it all!!! [img]/ubbthreads/images/icons/smile.gif[/img]
Actually not too exciting, but it is a starting point. In this thread I will provide examples of useful macros that you can use to extend the functionality of AMS40. I also welcome any and all questions, bug reports, etc. about the macro support. I'll be more than happy to try and help out.
- Brett
Comment