title: How to print out to a text file folder names within folder names (AppleScript)
body: <p>I have a script that partially works.  I need to print out a list of folder names which is working.  But then I need to go inside of each of those folders into a specific path and then also print out those specific folder names.  Whenever I try and do this my text file comes out blank.  I have separated the text files to try and find the issue and I get the same result no matter what I try.  The first text file works but the second one is always blank.  I would ideally like the second text file o work with that format specified in the script.  Any guidance would be greatly appreciated.</p>
  
  <pre><code>tell application "Finder"
  with timeout of 3600 seconds
      set src to (path to me) as string
  
      set multiPath to (src &amp; "Contents:Resources:Fixed multiSteps")
  
      set zipFiles to {".zip"}
  
  
      set allPlugins to get name of every folder in folder ("" &amp; multiPath &amp; "") whose name extension is not in zipFiles
      set outputFile to ((path to desktop as text) &amp; "pluginNames.txt")
      set typeFile to ((path to desktop as text) &amp; "types.txt")
  
      set fileReference to open for access file outputFile with write permission
  
      set filetypeReference to open for access file typeFile with write permission
  
      try
          repeat with a in allPlugins
  
              write a &amp; return to fileReference
  
              set innerPath to (a &amp; "Double Click to Install.app:Contents:Resources")
  
              set innerFolders to get name of every folder in folder ("" &amp; innerPath &amp; "")
  
              repeat with b in innerFolders
  
                  write a &amp; " - " &amp; b &amp; return to filetypeReference
  
              end repeat
  
          end repeat
  
      end try
  
  end timeout
  
  end tell
  </code></pre>