Topic: https://brettterpstra.com/2014/02/17/automating-dynamic-date-math-in-textexpander/
hide preview

What's next? verify your email address for reply notifications!

ttscoff 11y, 30d ago

Yep, that's what I was expecting, totally forgot about the consequences of having the reusable script be Shell. Nice work!

hide preview

What's next? verify your email address for reply notifications!

ttscoff 11y, 30d ago

Do you mean evaluating the string as a variable? http://hacktux.com/bash/var...

I should test this out, it would be a handy snippet to have if we can make it work. I'll let you know.

hide preview

What's next? verify your email address for reply notifications!

Chris 11y, 31d ago

Awesome!

hide preview

What's next? verify your email address for reply notifications!

ttscoff 11y, 31d ago

Check this out: you can include shell snippets in other shell snippets. So you could (and this is untested) take your reusable function and make a snippet out of it. Call it ",datemath" or something. Edit the TARGET= line to:

TARGET=${!day}

Then, in the "Next Tuesday" snippet, you can just do:

#!/bin/bash
day=TUE
%snippet:,datemath%

That would save repeating the script over and over for other day snippets...

hide preview

What's next? verify your email address for reply notifications!

ttscoff 11y, 31d ago

Lots of examples in the Tools snippet group I offer:

http://brettterpstra.com/sh...,,

hide preview

What's next? verify your email address for reply notifications!