7 Replies Latest reply on Dec 3, 2009 1:53 PM by DawMatt

    Bug with LrPathUtils.getStandardFilePath('appPrefs') on Mac

    DawMatt Level 3

      Hi,

       

      Has anyone tried using LrPathUtils.getStandardFilePath('appPrefs') on a Mac before?

       

      Sean is testing a plugin for me and it is returning:

           /Users/username/Library/Preferences/Adobe/Lightroom

      as the directory.

       

      According to the knowledge base

      The preference file is the com.adobe.Lightroom2.plist file, located in the [username]/Library/Preferences folder.

       

      As a workaround I can just cut the "Adobe/Lightroom" from the end of the string.  But can someone confirm whether this is a bug, or is there some nuance of tracking down preference files that I'm missing?

       

      Thanks,

      Matt

        • 1. Re: Bug with LrPathUtils.getStandardFilePath('appPrefs') on Mac
          escouten Adobe Employee

          Sounds like a bug to me.

          1 person found this helpful
          • 2. Re: Bug with LrPathUtils.getStandardFilePath('appPrefs') on Mac
            SeanMcCormack Adobe Community Professional

            I guess that's a relief in some ways

            • 3. Re: Bug with LrPathUtils.getStandardFilePath('appPrefs') on Mac
              DawMatt Level 3

              escouten wrote:

               

              Sounds like a bug to me.

              OK, in that case I'll lodge a bug report to get it into the system.  Thanks for the confirmation.

               

              Matt

              • 4. Re: Bug with LrPathUtils.getStandardFilePath('appPrefs') on Mac
                escouten Adobe Employee

                I've looked into this a bit further just now, and I think I'm going to retract the bug report on this and leave the 'appPrefs' selector as it stands.

                 

                As I see it, there are two competing use cases for 'appPrefs' and they would call for different results:

                 

                (1) Wanting access to where Lightroom's preferences are stored.

                (2) Wanting a place on disk where it's safe to write your own preference-like files.

                 

                On Windows, these will point to the same directory. On Mac, they point to different places (as Matt correctly described above).

                 

                I think plug-ins like Matt's that are attempting to work directly with the LR prefs file are the exception, not the rule, so I'll favor the other use case.

                 

                I don't know off-hand how many plug-in developers are using appPrefs for the #2 case, but if I were to change the definition of appPrefs, it would break their plug-ins.

                 

                In Lightroom 3.0, I may add a new selector that points directly to the LR prefs file.

                1 person found this helpful
                • 5. Re: Bug with LrPathUtils.getStandardFilePath('appPrefs') on Mac
                  DawMatt Level 3

                  escouten wrote:

                   

                  I've looked into this a bit further just now, and I think I'm going to retract the bug report on this and leave the 'appPrefs' selector as it stands.

                   

                  As I see it, there are two competing use cases for 'appPrefs' and they would call for different results:

                   

                  (1) Wanting access to where Lightroom's preferences are stored.

                  (2) Wanting a place on disk where it's safe to write your own preference-like files.

                   

                  On Windows, these will point to the same directory. On Mac, they point to different places (as Matt correctly described above).

                   

                  I think plug-ins like Matt's that are attempting to work directly with the LR prefs file are the exception, not the rule, so I'll favor the other use case.

                   

                  I don't know off-hand how many plug-in developers are using appPrefs for the #2 case, but if I were to change the definition of appPrefs, it would break their plug-ins.

                   

                  In Lightroom 3.0, I may add a new selector that points directly to the LR prefs file.

                  Hi Eric,

                   

                  Thanks for looking into this further.

                   

                  The explanation above doesn't quite work for me.

                   

                  On Mac the preference file is found at:

                  /Users/username/Library/Preferences/com.adobe.Lightroom2.plist

                  and the presets etc at:

                  /Users/username/Library/Application Support/Adobe/Lightroom


                  On Windows the preferences file is found at:

                  \Documents and Settings\username\Application Data\Adobe\Lightroom\Preferences\Lightroom 2 Preferences.agprefs

                  and the presets etc at:

                  \Documents and Settings\username\Application Data\Adobe\Lightroom

                   

                  In use case #2 I would expect the Mac version to return the /Users/username/Library/Application Support/Adobe/Lightroom value.  At the moment it seems to be mashing together the two possible Mac values to provide a completely new value (/Users/username/Library/Preferences/Adobe/Lightroom).  I don't have a Mac so can't confirm this, but I'm guessing the directory pointed to by that value doesn't exist.

                   

                  So I 100% agree with your sentiments in focussing on use case #2 (my plugin does have a rather unusual use case), but I think we have modified the bug report, rather than withdrawn/retracted it.

                   

                  Thanks,

                  Matt

                  • 6. Re: Bug with LrPathUtils.getStandardFilePath('appPrefs') on Mac
                    escouten Adobe Employee

                    Shoot. Wish I'd looked at this earlier. Was thinking it was a bug and I let it sit in the bug queue for a while.

                     

                    If you're looking for the standard location for Lightroom's presets, etc., what you probably want is LrPathUtils.getStandardFilePath('appData'), not 'appPrefs'. This was not documented in prior versions, but should work all the way back to LR 1.3. I'll add it to the next rev of the SDK docs.

                    • 7. Re: Bug with LrPathUtils.getStandardFilePath('appPrefs') on Mac
                      DawMatt Level 3

                      Hi Eric,

                       

                      Thanks for letting me know about this!  Will update the plugin and thanks for updating the doco.

                       

                      Thanks,

                      Matt