【发布时间】:2017-10-28 00:45:25
【问题描述】:
我有一个部分有效的脚本。我需要打印出一个有效的文件夹名称列表。但是我需要进入每个文件夹的特定路径,然后打印出这些特定的文件夹名称。每当我尝试这样做时,我的文本文件都会显示为空白。我已将文本文件分开以尝试查找问题,无论我尝试什么,我都会得到相同的结果。第一个文本文件有效,但第二个文本文件始终为空白。理想情况下,我希望第二个文本文件使用脚本中指定的格式。任何指导将不胜感激。
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
【问题讨论】:
标签: macos loops directory applescript macos-high-sierra