How to Change the Name of a Copy of an App?

This is not exactly a KBM issue, but I will use the solution with KBM and there are a lot of folks here who have a lot of arcane knowledge about how things work on Macs.

I am trying to create a duplicate to be able to have open a very specific set of TextEdit files, not affected by other TextEdit files that may or may not be in use. I can simply copy to TextEdit and it works for most of my needs, The icon in the taskbar says "TextEdit copy", I can use AppleScript to tell application "TextEdit copy"... etc. However, the main menu still says "TextEdit" and I have trouble telling which version I'm in until I open the Windows menu and that's pretty awkward in my workflow.

So I'm looking for solutions to change the Main Menu app name. I found a supposed solution at How do I rename an app in MacOS properly?. I've found this same "answer" about changing either CFBundleDisplayName or CFBundleName in either the main Contents/Info.list or language-specific Resources files such as Resources/XY.lproj/InfoPlist.strings in several places other than this. But for me, this solution does not work.

I'm on Catalina, the latest my hardware supports. When I change the Contents/Info.list file and run TextEdit, it crashes. And the Resources/en.lproj/InfoPlist.strings file doesn't even have "TextEdit" in the file, it's all about Microsoft (weird, yeah?), maybe because of RTF.

You all have TextEdit on your systems. Can anyone give me some guidance on how to change the Main Menu name of a copy of TextEdit?

Keyboard Maestro cannot help you with any of this I'm afraid.

Also, I highly recommend against all of this - Mac applications generally cannot be run safely multiple times simultaneously. Both copies will share their preferences (and possibly corrupt each other) unless they are explicitly written for this sort of behaviour (eg Chrome I believe). And editing an application will break the code signing, which can cause all sorts of weird behaviours.

So maybe it can be done, but I certainly wouldn't do it. My suggestion would be to find some other text editor and use it for your documents.

I understand that, I did not expect KBM to be able to go anywhere near the innards of this problem.

Primarily, I expect to use KBM to respond to hotkeys by executing AppleScript scripts. Simply by copying the existing TextEdit app, I can use AppleScript to separately address each of the two TE instances by name. But the Main Menu name being the same is confusing and annoying for my purposes. I'd like to fix that, if I can. So I'm asking wherever I know that experts in Mac Arcana hang out.

For example:

Thanks for that advice. In the various places, e.g. Ask Different/Stack Exchange, where I have found existing suggestions for how to do this kind of thing (which have not worked for me), no one has warned about these possibilities. I appreciate your expertise.

1 Like

It turns out that Text Edit is public domain and Apple used to ship the full source with Xcode installations. So the solution to my original question is to use Open Source apps.

Here is a link to a version available on GitHub for OS 10.8 (TE v10.8 build 301) that compiled and ran for me using Xcode 11.3 on Catalina (thanks to @_jims for the link):

Here's a link to a later version direct from Apple, which is the version for OS 10.9 (TE v1.9 build 309). This version did not compile on Catalina:

For reference, the version that was installed with Catalina is TE v1.15 build 355.

When compiling the GitHub version (v1.8) on Catalina with Xcode 11.3, I got 37 build warnings, 28 of which are Deprecation errors, but it did run. The later version from Apple (v1.9) had a fatal error and would not run for me on Catalina.

The fatal error turned out to be in the localization strings files. Xcode couldn't tell how to open the file. Opening each of the problematic files in an external editor (my Xcode installation defaults to using BBEdit) they looked like normal XML files, but not in Xcode. Various intenet solutions from Stack Exchange etc. about the UTF encoding error were pretty useless. What worked form me was simply copying the entire text of the file from the external editor, BBEdit, and then pasting that over the contents in the Xcode editor. One after another, the files dropped off the Errors list and then suddenly the project built and I had a blank TextEdit window open up.

Both the v1.8 build 301 and v1.9 build 309 versions, when fixed and running, have very similar sets of deprecation warnings and other warnings. Apple doesn't appear to really fix anything between those versions. Both have some deprecation errors that say the function was first deprecated in MacOS 10.7.

1 Like