# Smart Rule If open Group XYZ → automatically select Table of Contents Document

**URL:** <https://discourse.devontechnologies.com/t/smart-rule-if-open-group-xyz-automatically-select-table-of-contents-document/59650>\
**Category:** DEVONthink\
**Created:** [November 20, 2020, 7:45am UTC](https://discourse.devontechnologies.com/t/smart-rule-if-open-group-xyz-automatically-select-table-of-contents-document/59650 "2020-11-20T07:45:33Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [November 20, 2020, 2:57pm UTC](https://discourse.devontechnologies.com/t/smart-rule-if-open-group-xyz-automatically-select-table-of-contents-document/59650/7 "2020-11-20T14:57:00Z")

</div>

> [@BLUEFROG](#):
>
> This is unnecessary

That might be true in this script, but not in general.

Not sure where and when exactly this happens, however in some situations `type as string` returns raw syntax. Had a hard time figuring that out.

@cgrunenberg, I just checked the new hint about the `type as string` issue …

> [@Tips: Insert video into markdown notes](https://discourse.devontechnologies.com/t/tips-insert-video-into-markdown-notes/58717/20):
>
> It doesn’t make a difference whether it’s in the menu or toolbar over here, the conversion of the type to a string fails. The mysteries of AppleScript 🤔

… in the dictionary …

> Note: In compiled menu/toolbar scripts you might have to use a string representation of the type for comparisons.

… to show @BLUEFROG that it’s a known issue - but it’s not mentioned 😳

Wouldn’t it make sense to add “and its raw syntax”? Without it users get only half of the solution …

> [@Tips: Insert video into markdown notes](https://discourse.devontechnologies.com/t/tips-insert-video-into-markdown-notes/58717/21):
>
> A workaround might look like this:
> 
> `if recordType as string is "quicktime" or recordType as string is "«constant **** quti»" then`

… I think.

---

_[View the full topic](https://discourse.devontechnologies.com/t/smart-rule-if-open-group-xyz-automatically-select-table-of-contents-document/59650)._
