Using a script, Is there a way to capture the switch tab event (clicking on a tab) in the document view?

I would like a script to execute each time a tab is clicked in the document view. Is this possible?

Also, besides in the events that you can hook into through the smart rule, is there a list of other events that are available?

Thanks

I would like a script to execute each time a tab is clicked in the document view. Is this possible?

No, there’s no built-in mechanism that detects selecting a tab in the interface.

Also, besides in the events that you can hook into through the smart rule, is there a list of other events that are available?

All smart rule actions are listed in the Help > Documentation > Appendix > Smart Rule Events and Actions.

And there are no other events that can be detected directly via an AppleScript?

Also, can these events be captured directly in an AppleScript without a smart rule. For instance can I detect an import directly in AppleScript. Just trying to learn what is available.
Thanks

And there are no other events that can be detected directly via an AppleScript?

No. And AppleScript isn’t detecting them. DEVONthink is.

Also, can these events be captured directly in an AppleScript without a smart rule. For instance can I detect an import directly in AppleScript. Just trying to learn what is available.

No. Again, it’s DEVONthink detecting the event trigger, e.g., On Import.

The only one outside smart rules is the on triggered handler, as described in the Help > Documentation > Automation > Triggered Scripts section.

Try BetterTouch Tool. It is, afaik, able to detect mouse clicks in apps. However, it has no knowledge of the structure of these apps. So telling BTT where to expect a mouse click is a not an easily to solve challenge.
Update: No, BTT can not detect normal click events. So no chance there either.

Apart from that: There is no such thing as “directly” in AppleScript. It is always talking to an app (or to System Events…) It is not a separate entity, that “is” somehow, but a programming language. Fortunately, it cannot grab events from under an application – that would open up a security hole from here to the moon. Just think about you in your banking website in the browser and an Applescript silently grabbing your keystrokes… Shudder.

Thanks @BLUEFROG for clarifying.

Thank you for explaining it and trying to find a workaround.

I just thought that just like the app is exposing objects properties etc maybe it also exposes events.

Steven

You’re welcome :slight_smile: