I have an applescript that creates a large number (4 - 20) smartgroups when certain conditions are met. Sometimes when I run the script, it works fine. However, about three-quarters of the time, it mysteriously closes my main open window while it operates. The script still functions, and when I reopen the window, the new smart groups have all been created. However, it is annoying to keep having to reopen the window every time. I am running the script with the same parameters each time and there are no lines in the code that open or close any windows. The only thing I can imagine is that sometimes DT gets overwhelmed with the number of new groups being created and closes the window? However, I really have no idea. Do you have any suggestions? Unfortunately, I can’t easily share the script. It is very long and across about 8 different libraries.
Does the script also delete anything, e.g. local smart groups?
Yes it does.
Assuming that a local smart group is selected in the sidebar and deleted (not just trashed), then this might explain the issue.