4 Replies Latest reply on Feb 6, 2014 3:49 AM by mcrostie

    Extracting DATA (mp3) from a USB drive

    mcrostie

      Hi

       

      Any way of extracting the DATA of around 1000 songs from a USB drive??

       

      Thanks

       

      Michael

        • 1. Re: Extracting DATA (mp3) from a USB drive
          mikebeargie

          Michael, what is your goal?

           

          Do you just want to transfer all the files from a USB drive to ~1000 records of container fields in FileMaker?

           

          The hardest part would be to dynamically pull the list of *.mp3 files that are in that drive. Scriptmaster, a free plugin for FM, has the ability to list all files from a directory

          http://www.360works.com/scriptmaster/

           

          You'd be looking for "List Files Recursively", which will return a list of all files, even in subdirectories.

           

          Then you could script to process your file list to get only .mp3 files, and finally script to process that list into records for FM.

           

          Something like this:

           

          Set Variable $rawlist = ListFilesRecursively(directory)

          Loop

             Set Variable $i = $i + 1

             Set Variable $val = GetValue ( $rawlist ; $i )

             If ( right ( $val ; 3 ) = "mp3"

                Set Variable $mp3list = $mp3list & break & $val

             End If

             Exit Loop If $i = ValueCount($rawlist)

          End Loop

          Set Variable $i = ""

          Loop

            Set Variable $i = $i + 1

            Set Variable $val = GetValue ( $mp3list ; $i )

             new record

             insert file ( to container from $val)

            Exit Loop If $i = ValueCount($mp3list)

          End Loop

          • 2. Re: Extracting DATA (mp3) from a USB drive
            mcrostie

            Thank for the info Mike

             

            I do want to database the files that are files for a Karaoke system and make a list of all the songs - I would also like to seperate the file names (file path) for each record. I will check the plugin first

             

            Regards

             

            Michael

            • 3. Re: Extracting DATA (mp3) from a USB drive
              mikebeargie

              See my blog post about FileMaker 13's GetContainerAttribute() function:

              http://www.anvildataworks.com/?p=1331

               

              There's a demo file that shows how you can pull metadata off imported .mp3 files. Additionally, you could write the results of $rawlist, $mp3list and $val into text fields using the Set Field script step as part of the loop.

               

              Also, if the thumb drive will always be in a consistent location when using the database, I would recommend storing containers as a reference so your database does not get overloaded, especially since it didn't sound like you needed any ability to play from inside the database.

              • 4. Re: Extracting DATA (mp3) from a USB drive
                mcrostie

                Thanks Mike

                 

                The plugin works for what I require, the results from the $rawlist is what I was after as a starter. I will look at your blog shortly.

                 

                Thanks again