문제

I'm having an issue trying to get applescript to locate a file with random characters in it. I'm able to get to where the folder is located, but how do I find that folder? Here is my scenario:

1) folder is always going to have .default in the end of the folder. 2) The first part of the folder name is randomly generated characters.

Here is my code so far.

    set FolderPath to ((path to home folder as text) & "Library:Application Support:Firefox:Profiles")

    tell application "Finder" to get every folder of folder FolderPath

For those who are interested, I'm trying to modify the pref.js file inside of the default folder of FireFox.

Currently on my machine the folder has this file name: tsv5su2x.default

도움이 되었습니까?

해결책

Try:

tell application "Finder" to set myFolders to folders of folder FolderPath whose name extension = "default"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top