3 Replies Latest reply on Apr 12, 2015 2:50 PM by Qwertyfly...

    Pallets communication with each other

    Zantcor

      Is there anyway to have pallets communicate with each other?  I have a script that opens up a shared document, pastes the selected artworks, moves them to the correct location, saves and closes.  The problem is if Artist A uses it then Artist B, if Artist A's script isn't done and saved then everything that it does will be over written when Artist B's script saves.  It's that big of a problem right now as the scripts execute really quickly but once or twice a day still adds up to quite a bit of time lost by the end of the year and sometimes if it isn't caught then it adds up to wasted material.

       

      What I need to happen is when Artist A runs the script that it sends a hold messaged to the other Artists pallets to not be able to run that script until Artist A sends the done message.  All the computers are hooked up to the same server where the scripts are stored so Artist A and Artist B are running the exact same script from the exact same location each time it is ran but the variables that are created are on the computer not the server.  Is there a way to pass a variable from computer A to computer B through the server or even pass a variable to the server that is checked by all the pallets first before the script is ran?

        • 1. Re: Pallets communication with each other
          Silly-V Adobe Community Professional

          I would like to see some good solutions to this anyone can provide! As for the simplest route, I would make the scripts put a text file, or marker next to the AI file, and have it hold variables, etc. Then, your scripts can first look for the file to see if the document is occupied, and react accordingly. When the occupying script is done, it could remove the file.

          • 2. Re: Pallets communication with each other
            Zantcor Level 1

            I could do that, just make an empty text file.. do something like this

             

            - Check if it exists - wait - check again - then prompt user - else - create text and proceed - when done delete

             

            var waiting = file "wait.txt";
            
            w.onShow = function ()
            {
            if (waiting.active == true)
            {
            alert ("Document is open, please hold")
            wait $400
              if (waiting.active == true)
            {
            alert ("Document is still open, please try again later")
            }
            } else {
            new file "wait.txt"
            
            run functions needed
            
            delete "wait.txt"
            
            alert ("artwork has been placed")
            

             

             

            I know that isn't correct but I didn't feel like writing the entire thing out just yet, but I bet I could do something along those lines.

            • 3. Re: Pallets communication with each other
              Qwertyfly... Level 4

              you could run a log.

              Create ted text file if does not exist.

              if does exist. Check last line for finished tag.

              add time stamp and username etc. add amother time stamp when finished.

               

              then you could display who has the file open etc...