title: How to detect files (even in subfolders) with a specific extension and open them?
body: <p>I'm trying to make a droplet applscript app. It should do:</p>
  
  <ul>
  <li>when a folder is dropped it should "scan" the folder,its subfolders and files</li>
  <li>every file with a specific extension (such as: .txt" should be opened in an program and something should be done</li>
  <li>that's all</li>
  </ul>
  
  <p>I get this error when I detected the right file and if it is trying to open it (the app won't be started- before that I get this error and the script cancels):<code>class nmxt of alias "the path to the file" could not be read</code>
  Currently my script:</p>
  
  <pre><code>on open {input}
      set theFiles to (getFilesRecursively(input, "plhs"))
      repeat with oneFile in theFiles
          if name extension of oneFile is "plhs" then
              tell application "Applic"
                  open oneFile
                  activate
                  tell application "System Events"
                      tell process "Applic"
                          click menu item "Save" of menu 1 of menu bar item "File" of menu bar 1
                      end tell
                  end tell
              end tell
          end if
      end repeat
  end open
  
  
  on getFilesRecursively(fContainer, fExt)
      tell application "Finder"
          set recursiveFileList to entire contents of fContainer as alias list
  
          set resultFileList to {}
          repeat with aFile in recursiveFileList
              if name extension of aFile contains fExt then
                  set resultFileList to resultFileList &amp; aFile
              end if
          end repeat
      end tell
      return resultFileList
  end getFilesRecursively
  </code></pre>