# \[solved\] AppleScript: Are Smart Groups in DEVONthink 3.6 broken?

**URL:** <https://discourse.devontechnologies.com/t/solved-applescript-are-smart-groups-in-devonthink-3-6-broken/59634>\
**Category:** Automation\
**Created:** [November 19, 2020, 6:40pm UTC](https://discourse.devontechnologies.com/t/solved-applescript-are-smart-groups-in-devonthink-3-6-broken/59634 "2020-11-19T18:40:53Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [November 19, 2020, 7:07pm UTC](https://discourse.devontechnologies.com/t/solved-applescript-are-smart-groups-in-devonthink-3-6-broken/59634/6 "2020-11-19T19:07:11Z")

</div>

YES, this works. Thank you very much 😃

```auto

tell application id "DNtp"
	try
		set theGroup to current group
		set theQuery to "kind:any"
		set theName to (theQuery & " in: " & (name of theGroup)) as string
		set theSmartGroup to create record with {type:smart group, search predicates:theQuery, name:theName} in theGroup
		set search group of theSmartGroup to theGroup
		open window for record theSmartGroup
		activate
		
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
		return
	end try
end tell

```

---

_[View the full topic](https://discourse.devontechnologies.com/t/solved-applescript-are-smart-groups-in-devonthink-3-6-broken/59634)._
