5 Replies Latest reply on Mar 20, 2011 9:28 PM by leilakarnik

    How to extract all BMP files from inside .Dir File ?


      Dear Friends,

      I am not a graphic designer or developer, but i am stuck with me boss work.

      He had an old cd with pictures, HE gave it to me to export all pictures from the file.

      It was .CRT File , I was able to convert it to .DIR file at the end. The file opens perfectly in Adobe Director with out any frame or script inside but

      there are 900 pictures inside.

      I cannot copy paste 900 files to paint or save them one by one.

      Alll 900 files are in the Internal Cast Now.


      Please help me to solve this problem and treat me as a kid, please guide me step by step, and send me the link of xtra to be used if any.


      I promised him tommorow i will give him the pictures, please help.


      Thanks and best regards,

        • 1. Re: How to extract all BMP files from inside .Dir File ?
          Chunick Level 3
          1. Download the ImgXtra from Valentin Schmidt's site here: http://www.dasdeck.de/staff/valentin/xtras/image/win/d10/
          2. Put FreeImage.dll and ImgXtra.x32 files from the zipped pkg. into the Xtras folder of the Director application*
            *Note: if running D10 then it's located somewhere like: C:\Program Files\Macromedia\Director MX 2004\Configuration\Xtras\
          3. Open up your .dir file and add this moviescript:
          on saveImages savePath
            retVal = 1
            -- check savePath
            if (not stringP(savePath)) and (not savePath contains "\") then
              retVal = -1
              return retVal
              if the last char of savePath <> "\" then 
                savePath = savePath & "\"
              end if
            end if
            -- create instance of ImgXtra
            imgObj = xtra("ImgXtra").new()
            -- iterate through the Internatl Cast
            -- and save as bmp using the member name, 
            -- or if empty then "member_#"
            m = castLib(1).member.count
            repeat with i = 1 to m
              if member(i, 1).type = #bitmap then
                fName = member(i, 1).name & ".bmp"
                if fName = ".bmp" then fName = "member_" & i & ".bmp"
                put "savePath: " & savePath & fName
                ixErr = imgObj.ix_saveImage(["image":  member(i, 1).image, "filename": savePath & fName, "format": "BMP"])
                if ixErr = 0 then 
                  retVal = -2
                end if
              end if
            end repeat
            -- destroy instance of ImgXtra
            imgXtra = 0
              return retVal end

          4. run it from the message window, something like this:


          err = saveImages(the moviePath & "images")

          err will be a return value of 1 if successful, a negative number, if not... you can do this to get the value in the message window:

          put err


          the moviePath is the path to the .dir file and "images" is a subfolder in the folder where the .dir file exists. Adjust the path accordingly, eg. "C:\Images" or some valid path where you want the exported images to be saved.

          • 2. Re: How to extract all BMP files from inside .Dir File ?
            RanaMoon Level 1

            My Friend, Joshua, (you remind me only Joshua I knew, from the series Freinds) you are superman !!!

            thank you thank you thank you soooooo much..

            I can kiss you now if you are infront of me.


            Thank you for your support, it worked like a charm.....


            Keep smiling and keep walking, you made my day already !



            • 3. Re: How to extract all BMP files from inside .Dir File ?

              Hi Joshua,


              Your instructions were very helpful. i have a .dir file created in 2004. i downloaded director 11 (free version) to extract all the images from the slideshow (around 60). i found your post and it was very helpful. i've downloaded the ImgXtra files etc. as per your instructions.


              however, i'm kind of stuck with a script error when i run it from the message window. when i run the script from the message window, it says "Script error: comma expected"


              can you please see the script below and tell me what's wrong with it?


              err=saveImages(the moviePath Users\leilakarnik\movies\mystic journeys copy_test.dir, & "images" \Users\leilakarnik\movies)


              Can you please edit my script so that i can run it correctly and extract the files? i'm using a mac- OS X 10.5.8

              any help on this will be greatly appreciated.





              • 4. Re: How to extract all BMP files from inside .Dir File ?
                jchunick Level 2

                You need to pass a valid path as a string.


                It looks like you are trying to save the images to a folder in the user's directory... if you want to get the user's path then you will need to use something like buddyAPI to do that. See here for some info on using buddyAPI: http://www.mods.com.au/budapi_docs/baSysFolder.htm (Note: you can use up to 3 methods for free in buddyAPI; FileXtra4 from Ken Kersten will also get the system folders, and it's free. Check out the Mile High Table of Products for Xtras).


                userFolder = baSysFolder("users")

                err=saveImages(userFolder & "\My Pictures")


                or something similar.

                • 5. Re: How to extract all BMP files from inside .Dir File ?
                  leilakarnik Level 1

                  Thanks, will try this out.