Simple script to move item to current group from inbox

Below is a script I embedded in a database inbox group to be executed for Kind:Any Document “on import” or “on demand.” Neither moved an incoming item. Any ideas? (I’m sure I’m butchering AppleScript.)

  on performSmartRule(theRecords)
   tell application id "DNtp"
   	repeat with theRecord in theRecords
   		move theRecord to the current group
   	end repeat
   end tell
end performSmartRule

move theRecord to the current group

If you consult the AppleScript dictionary you will see you are missing a required word for this command: record

It should be: move record theRecord to the current group

However, I don’t think this is a wise approach as the current group could be any group and people are often moving through different groups throughout the day. I suggest it likely would be better to use a Move or File action with a static location.

Oh goodness. Thank you! Maybe I’m moving into naive territory, but this is working now, and it’s something I’ve been wanting in my workflow for literally years.

Maybe I’ll restrict it’s execution to “on demand” or maybe set up a separate database just for scanning and filing purposes.

Thank you! Thank you!

You’re very welcome.

One thing to be aware of when using any kind of automation, including smart rules, is the danger of too broad a scope for the actions.

If someone is targeting all open databases for a smart rule, I would strongly suggest caution and re-examining it before committing to the action. I would also suggest testing with the On Demand event first, unless you’re testing the effects of a specific event, like On Import.