我在尝试使用applescript查找包含随机字符的文件时遇到问题。我能够到达文件夹所在的位置,但如何找到该文件夹?这是我的情景:
1)文件夹总是在文件夹的末尾有.default。 2)文件夹名称的第一部分是随机生成的字符。
到目前为止,这是我的代码。
set FolderPath to ((path to home folder as text) & "Library:Application Support:Firefox:Profiles")
tell application "Finder" to get every folder of folder FolderPath
对于那些感兴趣的人,我正在尝试修改FireFox默认文件夹中的pref.js文件。
目前在我的机器上,该文件夹具有以下文件名:tsv5su2x.default
答案 0 :(得分:1)
尝试:
tell application "Finder" to set myFolders to folders of folder FolderPath whose name extension = "default"