4 Replies Latest reply on Sep 25, 2008 8:09 AM by Newsgroup_User

    open a folder

    budgiebird Level 1
      Hi all,
      I need to open a folder from a director movie, in its own window not in the director window. I know how to launch an app, but dont seem to be able to crack this one.
      Thanks
      - oh, and I'm using Windows, but a Mac answer would be cool too.
        • 1. Re: open a folder
          Level 7
          budgiebird wrote:
          > I need to open a folder from a director movie, in its own window not
          > in the director window. I know how to launch an app, but dont seem to
          > be able to crack this one.
          > Thanks
          > - oh, and I'm using Windows, but a Mac answer would be cool too.

          For Windows, you can use explorer.exe:
          http://support.microsoft.com/kb/152457

          If you're using BuddyAPI, you can use baOpenFile with the name of the
          folder, which also works on Macs.

          Andrew


          • 2. Re: open a folder
            James Newton, ACP Level 3
            The path to the folder you want to open will need to be an absolute path. This is true whether you choose to use Director's native "open with " command, or Buddy API's baOpenFile() command. The need for an absolute path raises two issues:

            1) Macintosh and Windows use different path delimiters to define an absolute path.
            2) On end-users' machines, the absolute path you provide is likely to be wrong.

            Is your application intended for a kiosk where you have total control of the system? If not, you will need to store the path to the folders as a relative path (with respect to the current movie), and convert back to an absolute path on the fly.

            You can find PathRelativeTo() and PathMakeAbsolute() handlers in the File Manager script that you can find here: [nonlinear.openspark.com]. The File Manager script depends on the two others, so be sure to copy all three scripts to your movie.

            You can then use the open() command to open the chosen folder. The application that will open the folder is different on Macintosh and Windows. Here's a code snippet to get you started:

            on mouseUp
            vFolder = the applicationPath -- oven-ready absolute path... or use your own

            if the platform starts "Mac" then
            vApplication = "Finder"
            else
            vApplication = "Explorer"
            end if

            open vFolder with vApplication
            end mouseUp
            • 3. Re: open a folder
              budgiebird Level 1
              so far I've tried
              -- open "C:\Program Files\Microsoft Office\Office10" with "explorer.exe"
              --open (QUOTE & C:\Documents and Settings & QUOTE) with "explorer.exe"
              --open ("C:\Documents and Settings") with "explorer.exe"
              --open " & C:\Documents and Settings & " with "explorer.exe"
              --open "C:\Documents and Settings" with "explorer.exe"
              --open "C:\Documents and Settings"
              --window("C:\Documents and Settings").open("explorer.exe")
              --window("C:\Documents and Settings").open()
              --window("C:\Documents and Settings") with "explorer.exe"
              --open "Explorer /root,\\Documents and Settings"
              --open "Explorer /root,\\Documents and Settings" with "explorer.exe"
              -- ("C:\Documents and Settings").open = "explorer"

              and not got anywhere :-(
              • 4. Re: open a folder
                Level 7
                budgiebird wrote:
                > so far I've tried
                <loads>
                > and not got anywhere :-(

                open("explorer.exe " & quote & "C:\Documents and Settings\" & quote)

                Andrew