Date Time modified

Adding last time you modified a method. (MacOS)
I couldn’t find a better way to do this (probably there is one…), so I’m posting how I did in case someone finds it useful.

Create a Xojo script

Var command As String
var t as string = chr(34) + "+Modified: %Y-%m-%d At: %H:%M:%S" + chr(34)

Var result As String
result = DoShellCommand( "Date "+ t + "| pbcopy")

text = "// " + clipboard + endofLine + text

Then save it and put in the Scripts folder

Then select it,

This will add to your method:

// Modified: 2024-01-19 At: 17:16:39


Handy, thanks.

I’ll point out that you probably don’t need this if you use source control like git where you can just check your logs to see all your modifications over time.

1 Like

A text expander tool like TextExpander can also be used to access this sort of functionality.