Triggered script bug?

Hi, a simple triggered script:

on triggered(theRecord)
tell application id “DNtp”
display alert “hi”
end tell
end triggered

if the current view is a group, it works for both group or document with attached script
if the current view is a smart group, it works only for group, on documents the attached script is not triggered.

Mac OS 10.15.7
DT 3.6.1

a little mor investigation about this show that the problem is the layout.
with the layout->None, the documents does not trigger script, (but groups do)
is by design?

my behaviour is to show related information in another windows based on selected document, @cgrunenberg said in another post

Triggered scripts are still supported but only to maintain compatibility to older databases, for new databases & workflows smart rules & reminders are highly recommended instead.

afaik there is not a selected action in smart rules, how could be used instead of triggered script?

Yes. Triggered scripts are executed when an item is opened (e.g. in a preview pane, tab or a window). Without a preview pane the document was not opened.

Thanks, but the preview of a document (Space pressed) does not trigger the script.
moreover there is some plan to add “select” action to rules or some other trick i can use to obtain the same goal?

The document has to be open in a preview pane (tab) or in a document window, the Quick Look panel doesn’t matter.

No. Smart rules should ideally work faceless in the background and not depend on user interaction.

ok, i understand the point.

if someone is interested in user interaction,
i have a document and want to show related ones in another window (tag filtered) pressing space bar.
i’ve simply remapped spacebar key only in DEVONthink application, if longpressed it launch a script that do the job.

Could you please post a screenshot or even the script? Sounds interesting

sorry, i forgot to reply

eg. in a smart group having all items, say, with red label, i have a selected records; i want pressing space to show related records (eg. with same parents) in another window (eg. showing tag @related)

i modified beaviour of spacebar key, only inside DevonThink, via Karabiner Element; pressing and helding spacebar a smart rules is triggered, a script will check conditions end eventually apply tags to parent group, showing related document inside filtered view.
very handy

Interesting. Any chance you could post the script too?