2 Replies Latest reply on Oct 17, 2013 8:08 AM by EL_MISMOLOCO

    Acute Accent...

    EL_MISMOLOCO Level 1

      Hi, I have this three scripts to read and retrive audio files and their time to a field member. The problem is that ACUTE CHARACTERS don't come out right.

      PLEASE, SEE AFTER THE SCRIPTS.

       

      on musicLoad

      musicPath = _movie.path & "MusicFolder"

      set the itemDelimiter = "."

      fxObj = xtra("FileXtra4").new()

      fileStructure = value(string(fxObj.fx_FolderToList(MusicPath)))

      fxObj = 0

      dialogText = ""

      repeat with p = 1 to fileStructure.count

      hhmm = getDuration(string(musicPath)&"\"&fileStructure[p])

      temp = dialogText &hhmm&&" "&& fileStructure[p]

      fileOnly = temp.char[1..(length(temp)-4)]

      dialogText = fileOnly & RETURN

      end repeat

      member("musicField").text = string(dialogText)

      end

       

      on getDuration filename

      theAudio = new(#sound)

      theAudio.fileName = fileName

      theDuration = theAudio.duration

      theAudio.erase()

      return formatElapsedTime (theDuration)

      end

       

      on startMovie

      member("musicField").text = EMPTY

      end

       

       

      on formatElapsedTime tm

      inttime = integer(tm)

      m = 0

      s = inttime / 1000

      if s >= 60 then

      m = s / 60

      s = s mod 60

      end if

      if s < 10 then s = "0" & s

      if m < 10 then m = "0" & m

      return m & ":" & s

      end

       

      And this is what I get:

       

      03:47 Brother Louie - Stories-01-1973-[USA]-ASCAP

      02:55 Build Me Up Buttercup - The Foundations-03-1969-[UK]-BMI

      03:45 Burning Heart - Survivor-02-1986-[USA]-ASCAP

      02:50 Bus Stop - The Hollies-05-1966-[UK]-BMI

      02:46 But It's Alright - J J Jackson-22-1966-[USA]-ASCAP

      02:42 Butcher's Tale - The Zombies-1969-[UK]-BMI

      02:39 By the Time I Get to Phoenix - Glen Campbell-26-1967-[USA]-BMI

       

      IT NOT ONLY MESS UP THE CHARACTERS, BUT ALSO DON'T GET THE TIME ON THE FILES

       

      00:00 Deja V�ionne Warwick-15-1980-[USA]-BM

      00:00 Volver� La Canci� Jos�Jos�M

       

      ORIGINAL FILE NAMES

      00:00 Deja Vú Dionne Warwick-15-1980-[USA]-BMI

      00:00 Volveré La Canción - José José - BMI

       

       

      I heard about an xtra named PRegEx, I download it, but it seems to complicated for me.

       

      Any help will be appreciated

       

      Thanks

       

      Brian

        • 1. Re: Acute Accent...
          Sean_Wilson Adobe Community Professional

          Your problem is using FileXtra4. You are using it to get filenames, some of which contain multi-byte characters. FileXtra4 wasn't engineered to handle these characters. Since you are only using it to grab a list of filenames in a folder, start by trying the same thing with Buddy API (which should handle high ANSI characters). I have re-written one of your handlers below and replaced FileXtra4 with Buddy API:

          on musicLoad
            musicPath = _movie.path & "MusicFolder"
            -- _player.itemDelimiter = "."
            fileList = baFileList(MusicPath, "*.*")
            dialogText = ""
            repeat with aFile in fileList
              hhmm = getDuration(musicPath & "\" & aFile)
              temp = dialogText & hhmm && " " && aFile
              fileOnly = temp.char[1..(length(temp)-4)]
              dialogText = fileOnly & RETURN
            end repeat
            member("musicField").text = string(dialogText)
          end
          
          • 2. Re: Acute Accent...
            EL_MISMOLOCO Level 1

            Thanks Sean, you saved my day!