Spotlight activity to log

I try to get all hd activity to log file during app installation, but all i get empty file. Thanks

set my_path to quoted form of POSIX path of ((path to desktop) & "tst.txt" as string)
do shell script "mdfind -live * >> " & my_path & " 2>/dev/null &"

Because the command will return into an error and that’s what you redirect to /dev/null.

When you’re using a “*” in bash, it will mean it will be replaced with a list of all files in this folder. Echo * give the contents of the current directory because bash replace the asterix with all the file names in the current working directory. It’s not mdfind that interprets the expression. To do that you need to escape the asterix

set my_path to quoted form of POSIX path of ((path to desktop) & "tst.txt" as string)
do shell script "mdfind -live \\* >> " & my_path & " 2>/dev/null &"