RTS Scripting - FAQ

  1. What is this Expert?
  2. What is the macro language I use?
  3. How do I add a menu to Delphi?
  4. How do I add a keyboard short-cut (i.e. Ctrl+Shift+L) that invokes one of my custom scripts?
  5. I have added my own macro code into the Expert. How do I upgrade?
  6. I have more than one of the Borland IDE's (C++Builder, Delphi, etc.). Can I use one Macro Library for all of them?
  7. I found a bug. What do I do?
  8. I get an access violation when the package is loading? What is wrong?
  9. new I get an access violation whenever I try to run a script? What is wrong?
  10. I have a cool macro, how can I add it to the library?
  11. How to I modify a form in my project?
  12. Can I use the source code for my own personal or commercial projects?
  13. Can I redistribute the Scripting Expert?
  14. Is the Scripting Expert "Open Source"?
What is this Expert?
This expert lets you write simple to complex wizards/experts or macros to manipulate the contents of the Borland IDE. Very often, it is simplier to make a macro in script than it is to code a complete expert using the Open Tools API. Using this expert you can create a macro that alters the source code or interacts with the IDE in some other manner. You can do all this without every having to compile an OpenTools API wizard or try "debug Delphi with Delphi".
What is the macro language I use?
Currently the expert only supports the use of Microsoft VBScript but the base engine source code supports the use of any Active Scripting enabled language. This includes JavaScript, Perl, and Python. We are currently examining how best to include support for multiple scripting languages. Let us know what which one is your favorite.
How do I add a menu to Delphi?
You can add a new menu using the "ide" method AddMenuMacro. This method attaches a new menu item to the Scripting menu and invokes the provided function whenever the menu or the hot-key is selected. In order to have it work correctly you must have the script defined inside one of the modules. You an do this by using Scripting | Configure | Modules and then adding your own module or using an existing one. Please see the next FAQ item for sample code.
How do I add a keyboard short-cut (i.e. Ctrl+Shift+L) that invokes one of my custom scripts?
By far the simplest way to add a keyboard short-cut is to use the following code model:
  '' the implementation of the menu item
  Private Function MyKeyboardShortCut()
    '' using the "ide" object do whatever you want
    ShowMessage "Hello from my keyboard short-cut"
  End Function

  '' attach the menu item to scripting menu with
  '' the given short-cut
  ide.AddMenuMacro "UniqueMenuName", _
                   "Menu Caption Here", _
                   "Ctrl+Shift+L", _
                   GetRef( "MyKeyboardShortCut" )
I have added my own macro code into the Expert. How do I upgrade?
The only way to upgrade is to use cut and paste to copy your code into the new library in the configuration dialog. This will be resolved in a future release.
I have more than one of the Borland IDE's (C++Builder, Delphi, etc.). Can I use one Macro Library for all of them?
Yes, the easiest way to do this requires that you edit the Registry. The expert stores the location of the library under the registry for each IDE that uses it based on the IDE's executable name (BCB, DELPHI32). Simply go to HKCU\Software\Run-Time\Borland IDE Script Expert and you will find a key for each IDE that you have. Edit the Storage value to specify the location of the library file that you want to use.
I found a bug. What do I do?
Let me know. Please provide steps and/or a small example that demonstrates the problem.
I get an access violation when the package is loading? What is wrong?
Usually this is a signal of one of the following:
  • The Microsoft Script Debugger (version 1.x or Visual Studio) has not been installed.
  • The latest version of the scripting engines (version 5.x) has not been installed.
  • You have found a bug.
I get an access violation whenever I try to run a script? What is wrong?
Due to bug in the first release you may get this error if you have never been into the script configuration dialog. The fix is to create the required string value in the registry for the storage file.

Delphi
  Note: Do not include the quotes
  HKEY_CURRENT_USER\Software\Run-Time\Borland IDE Script Expert\delphi32
    "Storage" = "path to your DELPHI32.RSY file"
C++Builder
  Note: Do not include the quotes
  HKEY_CURRENT_USER\Software\Run-Time\Borland IDE Script Expert\bcb
    "Storage" = "path to your BCB.RSY file"
I have a cool macro, how can I add it to the library?
E-mail the macro/script to me. I will see whether it can be included in the distribution. We reserve the right to not include any particular script or suggested modifications.
How to I modify a form in my project?
In this release you can't. Well not easily anyway. Hopefully this will be addressed in a future release.
Can I use the source code for my own personal or commercial projects?
Yes, provided that you following the terms of the license. Basically, you can use the source code for anything you want. The only thing expressly prohibited is the distribution of a modified Scripting Expert since this would result in compatibility issues with the COM objects as well as the packages. These items are tightly coupled and cannot be easily separated.
Can I redistribute the Scripting Expert?
Yes, provided that you following the terms of the license and include all components and copyright notices. You may not distribute modified copies and continue to associate your distribution with this distribution. Ideally you will include your modifications as additional files or replacement files that the end-user may choose to apply.
Is the Scripting Expert "Open Source"?
No, It is distributed as Freeware. Please refer to the licensing for further details on specific restrictions.

Please visit our web site for updates and frequently asked questions.