$ find /path/to/dir -name "*.txt" -exec /some/script {} \;