# Database selection in Applescript ignored when adding or moving a file

**URL:** <https://discourse.devontechnologies.com/t/database-selection-in-applescript-ignored-when-adding-or-moving-a-file/79633>\
**Category:** Automation\
**Created:** [May 11, 2024, 12:14pm UTC](https://discourse.devontechnologies.com/t/database-selection-in-applescript-ignored-when-adding-or-moving-a-file/79633 "2024-05-11T12:14:33Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [May 12, 2024, 6:42am UTC](https://discourse.devontechnologies.com/t/database-selection-in-applescript-ignored-when-adding-or-moving-a-file/79633/8 "2024-05-12T06:42:00Z")

</div>

Perhaps you’re making it more complicated that necessary.

- you could easily have Hazel send the files to the correct DT group
- or have DT do the tagging (is that needed for anything but to determine which group the file goes to?) and grouping itself.

I’ve written a sample script for the second approach sike time ago

> [@Using a single smart rule instead of Hazel (maybe)](https://discourse.devontechnologies.com/t/using-a-single-smart-rule-instead-of-hazel-maybe/67982/1):
>
> Some people (me included) use a naming convention for their files and put them in certain goups depending on sender and/or content. I’m doing that for bank statements, some of the regularly arriving invoices and income statements. In DT, you’d need one smart rule per target group, since it’s not possible to move a record to a group depending on some criteria. So if you have 5 bank accounts and two companies regularly sending you invoices, you’d need seven separate rules. Which is not good, beca…

---

_[View the full topic](https://discourse.devontechnologies.com/t/database-selection-in-applescript-ignored-when-adding-or-moving-a-file/79633)._
