Smart Group Search in: Script

Dear all,

I use following script to build a Smart Group:

tell application id "DNtp"
	--set theName to display name editor info "New Project:"
	--if theName is not "" then
	try
		set theSmartGroup to create record with {name:"Kein Fälligkeitsdatum", type:smart group} in current group
		set search predicates of theSmartGroup to "item:! Reminder"
		set highlight occurrences of theSmartGroup to true
	end try
	--end if
end tell

My Problem is, that I like to choose the "Search in: Area instead of database a current folder, how to mention this?

Can anybody help me?

Thank you very much!

Best regards

I don’t quite understand what you’re after. But perhaps adding scope: ... to your predicate is what you’re looking for.

Welcome @Artur

Why are you using a try… end try block here? While you’re developing the script, you’re inhibiting errors from being reported.

PS: Here’s a simple example…

tell application id "DNtp"
	set searchGroup to (display group selector)
	set theSmartGroup to create record with ¬
		{name:"Smart Group", type:smart group, search predicates:"kind:rtf", highlight occurrences:true, search group:searchGroup} in current group
end tell
1 Like

Dear @BLUEFROG
a lot of Thanks to you! Thank you very much, now works for me!

1 Like