Getting started |
Quick introduction and overview to get started with scripting in Fast video cataloger
Scripts are executed from the script console window in Fast video cataloger.
The upper part of the window allow you to write a longer program that is compiled and executed when you click run.
In the lower part you get the output from the scripts and you can execute single lines of scripts or load and run whole programs.
The scripts as well as code entered directly on the console command line are passed two arguments. On object named scripting that implements the IScripting interface an an argument string named arguments. Here is a simple "hello world" that you can paste straight into the script console: scripting.GetConsole().Write("hello world");
scripting is as said an object that implements the base scripting interface, IScripting, and is passed to all scripts. From the scripting object we use GetConsole() to get the IConsole interface. On the IConsole interface we call the Write() function that prints a text string to the console window.
Scripts are written in C# and automatically compiled right before they are run
You also have access to the full .net library from scripts. For example; If you want to use .net to show a dialog in a script you would write:
System.Windows.MessageBox.Show("Hello World");
For writing longer scripts we higly recommend a dedicated text editor that support C# syntax highlighting. For example Notepad++ or Visual studio (https://visualstudio.microsoft.com/vs/community/).
We have included a Visual studio solution in the script folder. You do not need to compile the scripts to run them but if you add your own script to the solution you get a good environment. You can compile your script to catch errors and you get help with the api throught intellisense.
In Fast video cataloger you load script into the script console by clicking "Load". If you hold the Shift key while clicking "Load" you re-load the same file again. A god workflow is to write your script in visual studio and then shift load them into Fast video cataloger.
Once you have developed a script you can create Actions and bind them to the script, actions appears as buttons in the action window and you can bind shortcut keys to your actions.