Esto parece funcionar. El único problema es que no es recursivo.
property Location : alias "Macintosh HD:Location"
tell application "System Events" to files of Location whose name extension = "ext"
if the result = {} then tell application "Example" to quit
Respuesta1
Puedes obtener el contenido completo con Finder:
set f to POSIX file "/Users/username/folder" as alias
tell application "Finder"
files of entire contents of f where name extension is "torrent"
end tell
Si la carpeta tiene muchos archivos, usar buscar probablemente sea más rápido:
do shell script "find ~/folder -name \\*.torrent" is not ""
Respuesta2
Intentar:
set downloadsPath to (path to downloads folder)
tell application "System Events" to files of downloadsPath whose name extension = "torrent"
if the result ≠ {} then tell application "Transmission" to activate