Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

FindChangeByList text files on shared drive?

Return to Member Forum

  • Author
    Posts
    • #1229517
      Rhea Wyss
      Member

      I manage quite a few unique FindChangeByList scripts for my team; each script has its own associated text file for the find/change queries. Whenever I modify and save changes to one of the txt/query files, I then have to go around to each user’s computer and update the text files in their FindChangeSupport folder. This can get cumbersome. I’m wondering if it’s possible to point the javascript to a file saved on our server instead.

      But, I can’t seem to figure out the correct way to make it work. No matter how I type the filepath in the script, it doesn’t like it. InDesign just opens the “Choose the file containing your find/change list” dialogue.

      The scripts are slightly modified versions of the “FindChangeByList” script that comes stock with InDesign. I’m using Windows 10, CC2018.
      The script is named FindChangeByListNAME1.jsx with a corresponding FindChangeByListNAME1.txt file.
      On line 113 of the script, it references the txt file:
      var myFindChangeFile = myFindFile(“/FindChangeSupport/FindChangeListNAME1.txt”)
      I want to change the quoted filepath to be the one saved on a mapped network drive. Is it possible?

      location on mapped drive is
      “F:\Production\5. Tools\1. Scripts\FindChangeSupport\FindChangeListNAME1.txt”
      (In my many attempts to make this work, I’ve changed the backslashes to forward slashes, changed the spaces to %20, and tried it all again using the full UNC path. None of it seems to make a difference. So it seems there’s a step that’s missing somewhere, but I’m not fluent in javascript enough to know what to try next!)

      Any ideas? THANK YOU!

    • #12243955
      Brian Pifer
      Participant

      Leave line 113 as: var myFindChangeFile = myFindFile(“/FindChangeSupport/FindChangeListNAME1.txt”)

      Then change the myFindFileFunction beginning around line 192 to:

      function myFindFile(myFilePath){
      var folderPath = “F:/Production/5. Tools/1. Scripts”;
      myFilePath = folderPath + myFilePath;
      if(File(myFilePath).exists == false){
      //Display a dialog.
      myFilePath = File.openDialog(“Choose the file containing your find/change list”);
      }
      return myFilePath;
      }

    • #12243968
      Rhea Wyss
      Member

      Hi Brian,
      Thank you! This 100% worked, and bonus, I learned from it.

      And, just because I’m curious: would it hurt anything if I eliminate the function that follows this one, the entire function myGetScriptPath(){...} (line 203-211 of the original)? Since the only place that function is called for is in one of the lines you removed?

      Thank you again!

    • #12432975
      Brian Pifer
      Participant

      My pleasure. Yes, if that’s the only place that function was called, then it’s fine to remove entirely.

    • #12294393

      Very nice. I also faced the same problem. But I solved it in a different way. I created a shortcut for my (findbylist.js and support directory) in the Adobe Scripts directory, which will point to the shared directory. Anyone can access the shared directory. Thanks.

    • #12433054
      Rhea Wyss
      Member

      Hey Radhakrishnan, that’s a super straightforward solution too, thank you for sharing!

Viewing 5 reply threads
  • You must be logged in to reply to this topic.
Forum Ads