Change case of library patcher name

    Sep 12 2021 | 11:56 pm
    I added a patcher file named sor.printerror.maxpat to the Max 8 Library. Later, I decided on Pascal case (capitalise words concatenated in name) as my personal standard for patcher names. So I renamed the file to sor.PrintError.maxpat :
    The case change was not reflected in instances of the object in other patchers. So I deleted all those instances and added them back in again. But the auto-completion list that is shown when adding an object still has the name in lower case. The same is true if I add the object to a patcher that has never previously contained it:
    After adding the library object to a patcher, I can manually change the case of the object name in the referencing patcher:
    But this is clearly not ideal.
    So how can I get the case of the object in the auto-completion list to change to reflect the change of the file name case in the library? Here's what I have tried and did not work:
    • I deleted the file from the library and added it back in again.
    • I confirmed (by viewing the problematic patcher with a text editor), that there was no reference (such as for a Title property) within the patcher itself to the lower case version of its own name.
    • I renamed the patcher to something completely different and then named it back again.
    My guess is that Max has somewhere cached the old name for display in the auto-completion list, retaining the cached name for possible future use even when the patcher was no longer in the library, and has not recognised the subsequent case change as a name change. If that is correct, perhaps there is a way (short of uninstalling and reinstalling Max) of clearing the cache.

    • Sep 13 2021 | 8:48 am
      it could be that the completion is implemented in lowercase deliberately - cycling also renamed some of the formerly capitalized factory objects to lowercase one day.
      have you tried adding those names in question to a max objectmappings.txt file in the package folder?
    • Sep 13 2021 | 9:18 am
      Hello Roman
      I've created several other library patchers with Pascal case names. As the screenshot of the auto-completion list in my previous post shows, they are not translated to lower case. Only the first one I made is. It's the only one that originally had a lower case name, which I changed when I decided on Pascal case as my standard. I've not tried using Objectmappings.txt. And I have not been able to find any relevant documentation. What exactly should I put in it?
      Thanks, Simon
    • Sep 13 2021 | 1:04 pm
      it is a textfile which you can put into /packages/mypackage/init/mypackage-objectmappings.txt, containing lines like that: max objectfile myobject+ myobjectplus; they use it to come around this restriction in the so called operating system windows, which is not able to allow arbitrary characters in filenames. ;) not sure why you see what you see but would be interested to learn about it.
      mb try to find any potential differences between the files. location stored in, if you wrote it into the objectlist or not, and so on. it seems superfluent that max tries to "correct" something against your will, when object names are not case sensitive anway.
    • Sep 13 2021 | 10:00 pm
      Thanks, Roman. Here's what I've tried.
      The packages folder in Windows is "Max 8\Packages" within the user's Documents folder, so in my case "E:\Simon\OneDrive\Documents\Max 8\Packages". Into that folder I saved a text file named objectmappings.txt. As the file is not specific to a particular package, I omitted the " mypackage-" prefix shown in your example. The objectmappings.txt file consists of the following text:
      objectfile sor.PrintError sor.PrintError.maxpat
      After creating objectmappings.txt, I loaded Max, which I understand should cause the contents of objectmappings.txt to be executed.
      Then I opened a new patcher and checked the object selection auto-completion menu. Unfortunately the object name remains in lower case.
      So that's not the answer. Or perhaps we are on the right track and it just needs tweaking. It did look like a promising thing to try.
    • Sep 14 2021 | 2:23 am
      Sorry, I got the objectmappings.txt syntax wrong. I should have followed your instructions more carefully, Roman! So here's my latest attempt, which includes a couple of additional use cases:
      max objectfile sor.PrintError sor.printerror; max objectfile sor.Abc sor.Def; max objectfile sor.ghi+ sor.ghiplus;
      where the Library folder contains files named sor.Def.maxpat, sor.ghiplus.maxpat and sor.PrintError.maxpat.
      None of these lines has any affect on the auto-completion list, even if I first reboot the computer for good measure:
      So I clearly do not understand how to make objectmappings.txt do anything. That being the case, objectmappings.txt might still provide a fix for the problem I originally reported.
    • Sep 14 2021 | 7:04 am
      Regardless of whether there is a workaround, this looks like a bug, which I have just reported. Here's the bug report I submitted:
      System Environment Max 8, Windows 10. Summary Case change in library patcher file name is not reflected in auto-completion drop-down.
      Steps to Reproduce Add to the Max library folder (e.g. "E:\Simon\OneDrive\Documents\Max 8\Library") a patcher with a file name of which all letters are lower case (e.g. "sor.casetest3.maxpat").
      Add the new patcher as an abstraction to another patcher.
      Unload Max. (Optionally reboot the computer to make sure.)
      Change the case of some letters in the library patcher's file name (e.g. "sor.CaseTest3.maxpat").
      Load Max.
      In another patcher, add a new object, typing as much of its name into the object box that the library patcher name is visible in the auto-complete drop-down.
      Expected Result The case of the letters in the library patcher's file name, as shown in the auto-complete drop-down, reflect the case change, as shown in the operating system's file system.
      Actual Result The letters in the library patcher's file name all remain in lower case.
    • Sep 14 2021 | 2:13 pm
      the syntax in the init files is important - if the filename is required to be in a certain form, no idea. (i just copied the style everyone seems to use.) would have been too easy if it was just that, but great that you tested it.