Most people know you can tailor the first half-dozen SmartIcons on your Notes workspace. Go into File | Preferences | SmartIcon Settings and you can add functions you want to add or drop things like "Open URL" that you don't use.
By selecting one of the Macro Button SmartIcons at the bottom of your list, you can add SmartIcons with your own formulas instead of relying on the pre-defined SmartIcons that Notes makes available to you. I find it especially useful to define two SmartIcons. One for @Command ([DebugLotusScript])(toggles debug mode on and off) and @Command ([FileDatabaseACL])(brings up the database ACL screen).
Another more complicated SmartIcon that I wanted to have is one that toggles the horizontal scroll bar on and off. The problem is that there are two functions under Notes that toggle scroll bars: @Command ([EditHorizScrollbar]) and @Command([ViewHorizScrollbar]). If you use @Command([ViewHorizScrollBar]) within a document, you get an error. If you use @Command([EditHorizScrollBar]) within a view, it's ignored completely. So how do you write one function that works in both places?
This isn't rocket science of course and all of us would figure this out if we thought about it awhile but I'll save you some time. I originally presumed there'd be some Notes @function that told you what mode you were in. Perhaps @IsInView vs @IsInDocument. But there are not functions like that. Instead, I had to come to a simpler solution by trapping the error and ignoring it.
I came up with the following SmartIcon formula that toggles on/off the appropriate scroll bar from within a view and from within a document:
([ViewHorizScrollbar])); @Success; @Success)