# Your Most Surprising Use for TextExpander?

**URL:** <https://community.textexpander.com/t/your-most-surprising-use-for-textexpander/95>\
**Category:** TextExpander Talk\
**Tags:** scripting, snippets\
**Created:** [February 13, 2025, 6:52pm UTC](https://community.textexpander.com/t/your-most-surprising-use-for-textexpander/95 "2025-02-13T18:52:20Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![macfixer](https://sea3.discourse-cdn.com/textexpander/user_avatar/community.textexpander.com/macfixer/32/1001_2.png) [@macfixer](https://community.textexpander.com/u/macfixer)\
**Post date:** [March 18, 2025, 3:19pm UTC](https://community.textexpander.com/t/your-most-surprising-use-for-textexpander/95/15 "2025-03-18T15:19:23Z")

</div>

This was originally an AppleScript that someone somewhere crafted for me, then TextExpander Support was kind enough to convert to JavaScript for me (I am not a coder).

It checks what time it is, then spits out “Good Morning/Afternoon/Evening” based on the time. I no longer need to check the clock before crafting an email or text.

The best part is that it works everywhere now, instead of just macOS.

```auto
var today = new Date();
var time = today.getHours();

if (time < 12) {
output ="Good morning"
} else if (time < 18) {
output ="Good afternoon" 
} else {
output ="Good evening"
}

```

---

_[View the full topic](https://community.textexpander.com/t/your-most-surprising-use-for-textexpander/95)._
