Domanda

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

È stato utile?

Soluzione

Try:

tell application "Finder" to set myFolders to folders of folder FolderPath whose name extension = "default"
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top