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, search group:theGroup, name:theName} in theGroup
--> missing value … and no valid smart group is created
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
I can confirm that, yes - I see the same behaviour. No error message, but a smart group is created with no rules and as such no content. These two conditions search predicates:theQuery, search group:theGroup are not being implemented.
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
The smart rule searches in all databases for items created today and with names matching a certain criteria. In this case it moves them to group X before synchronisation.
Now suppose you move one of these items from group X to group Y. This would require a new synchronization, I guess. So you are in “Before Synchronization”. It is still today, and the name still matches the criteria, I suppose. So what’s DT supposed to do? It has to move the item back to group X, because it is still today and the name criteria still match, I suppose.
You might want to change the “Search in” to “Inbox” or something else which is not “Databases”.
Then now it is behaving exactly as the rule says it should. As @chrillek suggested, the only way to be sure your file doesn’t get moved unintentionally is to reduce the scope of the search. Why not set the rule to search in “inboxes” rather than “databases”?
Because at any given time DevonThink is open anywhere(any database)
I have script that saves all current URL from Safari, I just execute it so whatever database is open thats where it lands, it then moves that item to Y-Group, But sometimes I wanna move this item to Z-Group. it used to work fine before 3.6 but now it moves back to Y-Gourp.
Will make some adjustments to see if things work out.
If you’re doing that with a script, it would be easy to adjust it to save to the global inbox (depending on the configuration of your script, something along the lines of set theInbox to root of inbox; in any case, inbox detonates the global inbox) rather than “anywhere” that should make the whole process rather more predictable