Mairlist Clock script

Guys, you are great

I really do appreciate you all taking the time to help me out with this one.

I think the latter option is the best so it runs an ACTION ON START/STOP script, i will put it to the test later on and let you know how i get on.

Thanks again

Lackster

Hi Guys,

Just tried the scripts and unfortunatly they didnt seem to do anything!

i tried adding the

begin
end.

to the end also to try it out and that didnt work either!

Any thoughts?

First of all, the Script posted by Cad fails to release the TStringList object (calling sl.Free), so it will leak memory over time. It is also favorable to put that into a try…finally…end block, so the object is released even if some of the other commands fail (technically, raise a so-called “exception”), e.g. when write access to the file or folder is denied.

// Set traffic flag ON
var 
  sl: TStringList;
begin
  sl := TStringList.Create;
  try
    sl.Add('TRAFFICFLAG');
    sl.Add('Status=1');
    sl.SaveToFile('C:\Program Files\mAirList\TRAFFICFLAG.txt');
  finally
    sl.Free;
  end;
end.

You should then make sure that the script is executed at all. This is usually done by adding a “SystemLog” command to the script and watching the message appear in the main window status bar. Just put the following line after the first “begin”:

SystemLog('yes, it works');

Also check if the filename is correct. Recent mAirList versions install themselves into “C:\Program Files\mAirList 3”.

Finally, it seems that the brackets are missing around “TRAFFICFLAG”, it should be “[TRAFFICFLAG]” instead, otherwise the output is no valid ini file and cannot be processed by Charlie’s tool (assuming that the file is supposed to be in ini file format, as suggested by the other scripts you posted).

Quick note, the output from SystemLog is not written to the status bar in the current version (I will change that), but you need to double click the status bar to open the System Log window and check the messages there.