IScripting Interface¶
Root of script interface to FVC. An object that implements this interface is passed to the run function.
Methods¶
| Method | Returns | Description |
|---|---|---|
GetSelection() |
ISelection | Get selection state object for current selection in the video catalog |
GetConsole() |
IConsole | Get the console interface for printing text during script execution |
GetVideoCatalogService() |
IVideoCatalogService | Get the current video catalog interface for database operations |
GetGUI() |
IGUI | Get the windows interface for controlling windows |
GetVideoIndexer() |
IVideoIndexer | Get the video indexer interface |
GetUtilities() |
IUtilities | Get the utilities interface |
GetVideoPlayer() |
IVideoPlayer | Get video player interface |
GetActionPipe() |
IActionPipe | Get action pipe for actions started by another application |
Example¶
class Script
{
static public async System.Threading.Tasks.Task Run(IScripting scripting, string arguments)
{
// Get the console to write output
IConsole console = scripting.GetConsole();
console.WriteLine("Script started!");
// Get selected videos
ISelection selection = scripting.GetSelection();
var videos = selection.GetSelectedVideos();
// Access the catalog database
var catalog = scripting.GetVideoCatalogService();
foreach (long videoId in videos)
{
var entry = catalog.GetVideoFileEntry(videoId);
console.WriteLine($"Video: {entry.Title}");
}
}
}