5 Replies Latest reply on May 24, 2006 8:24 AM by jlem

    Linking to External Script

    jlem
      Trying to format a runtime .exe file that will allow us to take a traditional notepad .txt file and (while declaring and assigning variables) will brand this exe to a particular entity. We're having trouble testing it although it does seem work. The cast has text fields assigned (and saved) as one thing, but when we run the projector, the new values come thru - that step is confirmed.

      Our problem is coming from taking the .txt file after running the projector at least once (where it brings in the new data) and changing the .txt file to be another entity. The values do not change/they remain the same as the first run brand. So we cannot really tell if it's working.

      I suppose the question is when we run a projector, are there prefs or items being stored on the computer keeping the "update" from happening?

      Thanks!
        • 1. Re: Linking to External Script
          ManOfMac Level 1
          I dont get what you're writing.

          Director reads a txt file, pulls the bits, then upon importing the file again even though the txt values have changed Director reads the 'old' values ?

          I use alot of txt file parsing and haven't seen this issue. I use Fileio so I will assume you have as well, try clearing your fileIO object. I know buddyapi keeps track of some paths but wouldnt imagin it would be keeping the info of a file.
          Gut feeling is you are not clearing an object, global or some other reference to the .txt file.

          Try popping up a 'open' window with Fileio and manually choose your file to see if this makes any difference!
          • 2. Linking to External Script
            jlem Level 1
            Sorry for the confusion - maybe I'm not even doing this the right way:

            I have a file called "indent.txt" located in an Assets folder subbed from the projector (and .dir workfile). I am not using FileIO - maybe that's my problem. The ident file reads as such:

            global identity, location
            on startMovie
            set identity = "Some Company Name"
            set location = " http://www.somelink.com"
            end startMovie

            I have this linked externally - as a script. When the movie starts, it extracts these global values and assigns them to text cast members to present on the stage (like "Welcome to Some Company Name" - then links to a website). When I run the .dir workfile, regardless of what the ident.txt file is set to it always refreshes/updates. When I commit this to a projector, it will take in the values as noted in the indent.txt file the FIRST time, then it seems to store those values and regardless of whether we update the ident file remains the same data as the "first run".

            The bottom line is that we are trying to make a shell projector that we can just change the ident file for each client and avoid the time to make new projectors for each client.

            Thanks in advance.
            • 3. Re: Linking to External Script
              jlem Level 1
              Okay I may have cracked this one with your previous kind advice. I split out the values to two files: ident.txt and loc.txt - using FileIO I am opening the files, assigning the strings to values and assigning those values to text fields to present on stage. I have yet to make the projector but it appears I'm at least on the right track.

              Thanks!
              • 4. Re: Linking to External Script
                ManOfMac Level 1
                Hers an excert from one of my projects that relies on a txt file:

                fileObj = new(xtra "FileIO")
                openFile(fileObj, (the moviePath&"SomeFile.txt"), 1) -- open the file at a given location
                text = readfile(fileObj) -- read the file, text now in memory!!
                --DO SOMETHING INTERSETING WITH THE RESULT
                -- DO SOME MORE ERROR CHECKING OR WHATEVER
                closeFile(fileObj) --IMPORTANT ALWAYS CLOSE FILEio

                Works everytime!!
                • 5. Re: Linking to External Script
                  jlem Level 1
                  That's pretty much what I did and it worked. Thanks.