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.
tell application "Finder"
with timeout of 3600 seconds
set src to (path to me) as string
set multiPath to (src & "Contents:Resources:Fixed multiSteps")
set zipFiles to {".zip"}
set allPlugins to get name of every folder in folder ("" & multiPath & "") whose name extension is not in zipFiles
set outputFile to ((path to desktop as text) & "pluginNames.txt")
set typeFile to ((path to desktop as text) & "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 & return to fileReference
set innerPath to (a & "Double Click to Install.app:Contents:Resources")
set innerFolders to get name of every folder in folder ("" & innerPath & "")
repeat with b in innerFolders
write a & " - " & b & return to filetypeReference
end repeat
end repeat
end try
end timeout
end tell