Using the following code:
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(gotIt:) name:nil object:nil];
I was able to find that the System Preferences application sends a notification with a name NSUserReplacementItemsEnabledChangedwhen changing text substitution settings.
Knowing that now you can publish the corresponding notification after changing the settings to find out all open applications:
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"NSUserReplacementItemsEnabledChanged" object:self];
Keep in mind that it is NSUserReplacementItemsEnabledChangednot documented anywhere, so this behavior can change at any time.
source
share