I solved the problem:
NSLocalizedString(...)
is a macro defined in NSBundle.h
as
#define NSLocalizedString(key, comment) \
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
This means that by using this macro, the Localizable.strings
files are searched in the main bundle of the Automator application, not the bundle of the Obj-c action!!! This is also documented here.
The bundle of the Obj-c action is obtained by [self bundle]
.
I thus replaced the wrong line
NSString *comment = NSLocalizedString(@"IMPORTED", nil);
by
NSString *comment = [[self bundle] localizedStringForKey:@"IMPORTED" value:@"" table:nil];
and everything works.
Hope this helps somebody else also!