5 Replies Latest reply on Jun 8, 2009 5:59 PM by fazstp

    ...connect to a shared folder on a MAC with director 11???

    DigitalDesignMedia Level 1

      Hi All,


      I developed a project a few years ago that work as follows.


      This was designed to work on Win XP, using Director MX2004

      Server Setup

      All the media files where installed on a server and the folder they resided in was setup as a shared folder.


      Workstation Setup

      A projector was installed on a workstation PC, along with the director projector, a txt file was install, the txt file contained the unc path to where all the media files resided. i.e. all director & video file etc.

      The projector file would read the text file, get the unc path, and open the appropriate dxr file.


      This worked really well.

      ___________________

      My question is, now I'm upgrading the software to Director 11, it is required to work the same way on MAC OSX. The only difference to the system will be that the media files will reside on a MAC server and the workstations will be MACs (Intel MACs running the latest OSX).


      How can you connect to a shared folder on a MAC with director 11?


      Its not '\\share_name'... should 'afp:\\share_name' work???


      I keep getting the can't find 'myfile.dxr' alertbox


      I hope I've explained myself well enough.


      Any help would be very much appreciated.


      Thanks,

      Jason

        • 1. Re: ...connect to a shared folder on a MAC with director 11???
          fazstp Level 2

          I don't know about doing it from Director 11 but you can do it with applescript.

           

          In the AppleScript ScriptEditor paste the following code then save it as an application (like "Mount.app") in the same folder as the projector.

           

           

          Next in Director you would write the volume path and password

          ie. afp://username:password@volumepath/sharename

           

           

          into a text file (like "Mount.txt")

           

           

          Then use open command from Director to mount the volume

           

          open _movie.path & "Mount.txt" with _movie.path & "Mount.app"

           

           

          -- applescript below

           

          on open (theFile)

           

            set theVolume to readFile(theFile as text)

           

            if (theVolume is "") then

              return false

            end if

           

            try

              mount volume theVolume

              return true

           

            on error

              return false

           

            end try

           

          end open

           

          on readFile(theFileName)

           

            try

              set theFileRef to (open for access file theFileName)

           

            on error

              return ""

           

            end try

           

            try

              set theText to (read theFileRef)

           

            on error

              set theText to ""

           

            end try

           

            close access theFileRef

           

            return theText

           

          end readFile

           

          • 2. Re: ...connect to a shared folder on a MAC with director 11???
            DigitalDesignMedia Level 1

            Hi Fazstp,

             

            Just wanted to say big thank-you , this worked a treat.

             

            Kind Regards,

            Jason

            • 3. Re: ...connect to a shared folder on a MAC with director 11???
              fazstp Level 2

              Glad I could help.

               

              I've barely scratched the surface when it comes to AppleScript but it can certainly be a valuable extension to interact with other applications.

               

              -Stephen

              • 4. Re: ...connect to a shared folder on a MAC with director 11???
                DigitalDesignMedia Level 1

                Hi Stephen,

                 

                Do you know to remove the mounted drive using apple script? I just want to tidy up after the app closes.

                 

                Thanks,

                Jason

                • 5. Re: ...connect to a shared folder on a MAC with director 11???
                  fazstp Level 2

                  Using a similar technique you could write the name of the mounted volume (just the name in this case, not the full path) to a text file and open it with a separate AppleScript app containing the applescript below. Note that any files you have accessed from the volume will probably have to be unlinked before Finder will be able to eject it.

                   

                   

                  on open (theFile)

                   

                    set theVolume to readFile(theFile as text)

                   

                   

                    if (theVolume is "") then

                      return false

                    end if

                   

                   

                    try

                      tell application "Finder"

                        eject theVolume

                      end tell

                   

                   

                      return true

                   

                   

                    on error

                      return false

                   

                    end try

                   

                   

                  end open

                   

                  on readFile(theFileName)

                   

                    try

                      set theFileRef to (open for access file theFileName)

                   

                   

                    on error

                      return ""

                   

                    end try

                   

                   

                    try

                      set theText to (read theFileRef)

                   

                   

                    on error

                      set theText to ""

                   

                    end try

                   

                   

                    close access theFileRef

                   

                    return theText

                   

                   

                  end readFile