scripting2
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
scripting2 [2020/07/10 10:52] – tondose | scripting2 [2020/07/13 14:25] – tondose | ||
---|---|---|---|
Line 7: | Line 7: | ||
The code resembles a subset of the // | The code resembles a subset of the // | ||
- | **Note:** The full set of mAirList functions and -procedures is featured only in the latest version of mAirList. Therefore, unaltered scripts originating from well-aged portions of the [[https:// | + | **Note:** The full set of mAirList functions and -procedures is featured only in the latest version of mAirList. Therefore, unaltered scripts originating from well-aged portions of the [[https:// |
+ | |||
+ | **Note 2:** Currently there is no listing which keywords of the complete // | ||
\\ | \\ | ||
Line 13: | Line 15: | ||
===== Creating Code ===== | ===== Creating Code ===== | ||
- | The code can simply be typed into a text editor. Windows-supplied '' | + | The code can simply be typed into a text editor, Windows-supplied '' |
- | The structure of a simple Delphi/ | + | The structure of a simple |
<code delphi> | <code delphi> | ||
Line 25: | Line 27: | ||
// Variable declarations | // Variable declarations | ||
- | { Subprogramme definitions } | + | { Subprogramme definitions: } |
procedure DoSomething; | procedure DoSomething; | ||
Line 32: | Line 34: | ||
end; | end; | ||
- | (* Main programme *) | + | (* Main programme: *) |
begin | begin | ||
Line 46: | Line 48: | ||
It is highly recommended to structure the code by indenting the statements with two whitespaces at a time. | It is highly recommended to structure the code by indenting the statements with two whitespaces at a time. | ||
- | [[https:// | + | [[https:// |
\\ | \\ | ||
Line 64: | Line 66: | ||
</ | </ | ||
- | ('' | + | at the end ('' |
=== Parameters === | === Parameters === | ||
Line 71: | Line 73: | ||
<code delphi> | <code delphi> | ||
- | // This code writes the item’s title into the System Log whenever a player is started | + | // This code writes the item’s title into the System Log whenever a player is started: |
procedure OnPlayerStart(PlaylistIndex: | procedure OnPlayerStart(PlaylistIndex: | ||
Line 77: | Line 79: | ||
SystemLog(Item.GetTitle); | SystemLog(Item.GetTitle); | ||
end; | end; | ||
+ | |||
+ | begin | ||
+ | end. | ||
</ | </ | ||
+ | |||
+ | **NOTE: It is absolutely essential to adopt the parameters in these '' | ||
\\ | \\ | ||
Line 84: | Line 91: | ||
===== Running Scripts ===== | ===== Running Scripts ===== | ||
- | **Standalone scripts** are run by external action, such as the menu item '' | + | **Standalone scripts** are run by external action, such as the menu item |
+ | |||
+ | '' | ||
+ | |||
+ | or the [[reference: | ||
+ | |||
+ | '' | ||
For making **background scripts** actually work with mAirList, the file has to be registered in the mAirList Control Panel: | For making **background scripts** actually work with mAirList, the file has to be registered in the mAirList Control Panel: | ||
Line 90: | Line 103: | ||
--> SCREENSHOT <-- | --> SCREENSHOT <-- | ||
- | While loading, the syntax of the code is checked. In case of errors a message is written into the system log, containing (somewhat obscure) the cause of the error and its location as '' | + | While loading, the syntax of the code is checked. In case of errors a message is written into the system log, containing (somewhat obscure) the cause of the error and its location as '' |