![]() ![]() This variable will contain any selected text or the body text of any single selected message (otherwise it will be empty, i.e. If selType isn't "undef", selList will always contain a list of references to the selected item(s). Type of window is not message window, mail list window, mailbox list or mail browserįocus ring is within a mailbox list but either nothing or "(outgoing mail)" is selectedįocus ring is within a message list but nothing is selectedįocus ring is within text pane but without any (single) message being selected Specifically, "undef" will be returned in the following cases: The "undef" identifier will be returned if it is either not possible to resolve the selection or if there's simply no selection. However, the reference to the related message can be always obtained from selList (see below). With any From-address, subject or notes being selected "text" will be returned as identifier. Note: The "single message" identifier will get returned also if any To-address or enclosure is selected. Depending on your selection, selType will be one out of the following identifier strings: This variable describes the type of the selection. The routine will return three variables, selType, selList and selString: This is exactly what this script framework does. They have to implement code to account for different kinds of selections.īut instead of re-inventing the wheel for every new script it's a good idea to build one routine that is able to manage all kinds of selections and that will produce a standardized output (which can be easily dealt with). And even worse, if there's no selection at all you'll be faced with an error.Īll scripts that deal with selected objects have to deal with that sort of problems. Again, if there's some text selected instead Mailsmith will return a string. In contrast to that, if multiple messages/mailboxes are selected you'll get a list of references back. ![]() Tell application "Mailsmith 1.1" to get selectionīut depending on your selection you'll get different result types returned: If you've selected a single message or mailbox you'll get a reference to this particular message or mailbox. It's simple to get the current selection from Mailsmith: Script framework that will return the current selection as listĪs well as the type of the selection. AppleScripts for Mailsmith - Get Selection ![]()
0 Comments
Leave a Reply. |