Rename files Selected in Path Finder and regex

The problem is that HFS defines the unicode as decomposed, so the accents are actually separate characters.

So you probably could just replace the accent characters.

But really the problem is that you are trying to do this yourself, when it is a task that has almost infinite complexity. Instead let some real system deal with it. For example, here is a Perl script solution that should work. The script is:

#!/usr/bin/perl

use warnings;
use strict;
use diagnostics;

use utf8;
binmode(STDOUT, ":utf8");

use Encode ();
use Unicode::Normalize ();

my $s = Encode::decode('UTF-8', $ENV{KMVAR_Process}, 1);
$s = Unicode::Normalize::NFD($s);

$s =~ s/\pM//g;
print $s;

Keyboard Maestro Actions.kmactions (1.3 KB)

1 Like