Bit of a long title ;D
Load the script through the config tool under scripting. Load as a notification script (not sure how an action script works as yet untried these).
If the coding is correct it will start, if not an error message will appear in the status bar.
Kind regards Tony
edit
In the notification scripts folder is a template script (Notification Script Template.mls)showing the commands available and the syntax to wrap around your code.
To have a script run every time mAirList starts, you need to create a Notification Script with code in its OnStartup section.
As Tony said, you can start from the template and put the code you want to run into OnStartup. You can then delete any On… sections you don’t need, but do not delete the final empty begin … end. because the script will not work if you do.
If the code to run on startup is complex or large (over fifty lines or so), you may prefer to leave it as a separate script, then run that separate script from within your OnStartup. Please ask if you don’t know how to do that (and I’ll find out and let you know ;)).
(PS to Tony: An Action Script is a script which will show up as a selectable Item Action, as in ‘Action On Start/Stop’ for Playlist Items, or a Cartwall Player.)
BFN
CAD
Thanks for the replies guys!
So in theory this should work yeah?
procedure OnStartup;
begin
Playlist(0).LoadFromM3U(‘C:\PLAYLISTS’ + FormatDateTime(‘ddmmyy-hh’, now + 0.04166) + ‘.m3u’);
SystemLog(‘Loaded Next Playlist ’ + FormatDateTime(‘ddmmyy-hh’, now + 0.04166) + ’ for playout/automation…’);
end;
Almost You’ll need to add a further begin / end. to the script:
[code]procedure OnStartup;
begin
Playlist(0).LoadFromM3U(‘C:\PLAYLISTS’ + FormatDateTime(‘ddmmyy-hh’, now + 0.04166) + ‘.m3u’);
SystemLog(‘Loaded Next Playlist ’ + FormatDateTime(‘ddmmyy-hh’, now + 0.04166) + ’ for playout/automation…’);
end;
begin
end.[/code]
That’ll load the 050608-11.m3u file if you were loading it today in the 11am hour.
Cheers Charlie! Yeah got that right eventually, as CAD said above
Is there anyway to get that script running every hour again - we are trying to set this up incase of a power cut!
For example, itll now load the playlist and start automation when mairlist boots which is fine, but the script doesnt run every hour unless i load it into the scripts window - is there anyway to automate that too?
Hi Libra28, this script is designed to use on startup only. Remember to restart mAirList on a reboot using a batch file if no-one is in the studio.
If you need it to load the next hour playlist for you, then use load next hour example by Charlie and run thorugh the event scheduler or use an append script.
Next Hour script:
[code]// Load the next hour’s Playlist (current hour + 1)
// Useful for logs created with StationPlaylist Creator
// by Charlie Davy
begin
Playlist(0).LoadFromM3U(‘C:\Playlists’ + FormatDateTime(‘ddd dd mmm - hh’, now + 0.04166) + ‘.m3u’);
SystemLog(‘Loaded Next Playlist ’ + FormatDateTime(‘ddd dd mmm - hh’, now + 0.04166) + ’ for playout/automation…’);
end.[/code]
Existing playlists will be cleared so set the scheduler to run close to the end of the hour.
We use this to append an existing playlist:
[code]begin
// Append Playlist
//Tony Wilding
CurrentPlayList.Appendplaylist(Factory.CreatePlayListFromFile(‘C:\playlists’ + FormatDateTime(‘ddd hh’,now + 0.04166) + ‘.m3u’));
end.
[/code]
Again scheduled as an event.
Once the next presenter is happy, they refresh the playlist using a runscript command from a keystroke. The script reloads the current hour playlist so its best to do this before any audio is played otherwise it gets reloaded too.
The current hour load script:
[code]// Load the current hour’s Playlist
begin
CurrentPlaylist.LoadFromM3U(‘C:\Playlists’ + FormatDateTime(‘ddd hh’, now) + ‘.m3u’);
end.[/code]
runscript is found in the config tool under remotes.
Remember to change the time and date format in the script examples I have included to suit.
kind Regards Tony
For loading the playlist from an event, I’d suggest to use the “Load playlist” action and enable variable replacement. Set the time offset value to the number of seconds before the top of the hour from when the event runs. Example: Event runs at :55:00, set time offset to 300 seconds (five minutes).
The time variables to use in the filename are the same as used for logging. See the Wiki for a reference.
mAirList 3.0 will have an “actions at startup” feature which will make the above suggested notification script obsolete.
Cheers guys!! Sorted!