use RISCOS;
use RISCOS::DrawFile;
use RISCOS::File 'globlist';

# A program to change the contexts of text areas using a regular expression.
# This RE makes all \AD\L24 into \AL\L24/\P24
# Now do that in !Draw with 12 files...

sub change {
    return unless my $met = $_[0]->can('TextArea');
    $_ = &$met($_[0]);
    $_ =~ s/\\AD\\L24/\\AL\\L24\/\\P24/;
    &$met($_[0], $_);
}

foreach $file (globlist (@ARGV)) {
    $draw = new RISCOS::DrawFile ($file,'+');
    $draw->Do(\&change);
    $draw->Write($file);
}
