3 Replies Latest reply on Oct 4, 2008 1:32 AM by (Gerald_Singelmann)

    Finding local settings of the user

    Level 1
      Hello all,

      I am afraid I am missing some basic understanding of at least the windows filesystem.

      I would like to write a script that processes the user's keyboard shortcuts. For that I would need the user to select the text file containing the exported shortcuts.

      I've got these lines to find the folder containing the text file in question:

       var pltfrm = File.fs;
      
      if (pltfrm == "Macintosh") {
        var dummyFile = new File("~/Library/Caches/Adobe InDesign/Version 5.0/InDesign SavedData");
      } else {
        var dummyFile = new File("~/Lokale Einstellungen/Anwendungsdaten/Adobe/InDesign/Version 5.0/Caches/InDesign/Standard.txt");
      }
      var bFile = dummyFile.openDlg ("Mit Vorgabe");


      This works fine on the mac.
      Under Windows it doesn't. Two questions:
      - won't this work because "local settings" is a hidden folder?
      - is there any way at all to point the open-file-dialog to that cache folder?
      - is there a language-neutral syntax for that path?

      Thank you for any help
      Gerald
        • 1. Re: Finding local settings of the user
          Peter Kahrel Adobe Community Professional & MVP
          Gerald,

          > Two questions:

          I count three :)

          >- won't this work because "local settings" is a hidden folder?

          "Local settings" is not hidden. The following line prompts ESTK to respond "true":

          File ('~/Local Settings/Application Data/Adobe/InDesign/Version 5.0/Caches/Indesign SavedData').exists

          The Mac and Windows paths appears to be different.

          >- is there a language-neutral syntax for that path?

          I don't think so: neither of the 12 Folder class properties (appData, commonFiles, startup, etc) leads you, well, up that path. Apart from the paths available from the Folder properties, the script folder is the only one that I know of that's language neutral because you can retrieve it with a script.

          >- is there any way at all to point the open-file-dialog to that cache folder?

          I think there were some problems with pointing that dialog to a particular folder.

          Peter

          Peter
          • 2. Re: Finding local settings of the user
            Peter Kahrel Adobe Community Professional & MVP
            A vague recollection was itching in the back of my head when wrote that previous message, namely, that there was something like localizedName. That turns out to be a property of the Folder object. See pp. 54-55 of the JavaScript Tools Guide. But all I get is "undefined", which isn't very helpful. Still, that may be the place to look.

            Peter
            • 3. Re: Finding local settings of the user
              Level 1
              Peter, thank you for responding,

              >I count three

              That happens to me all the time. I almost feel like a cardinal ;)

              >"Local settings" is not hidden.

              Well, I am much more fluent in MacOS than in Windows. In my Parallels installation I could only see that folder after changing my explorer-settings to "reveal hidden folders", though.

              >I think there were some problems with pointing that dialog to a particular folder.

              That would explain it. It does seem to work on the Mac side. But that's no help, really.

              I will tackle this thing from a different direction then. Thank you again for the input :)

              Gerald