Skip to content
Discussion options

You must be logged in to vote

I asked your question ChatGPT and got the following answer. I have not verified it.

Here's a complete Groovy script and accompanying explanation in English, tailored as a helpful post for a Freeplane user who wants to insert the current date into the text being edited — similar to Excel’s Ctrl+. behavior.


✅ Groovy Script: Insert Current Date at Caret Position in Edit Mode

import javax.swing.*
import java.awt.*
import java.time.LocalDate
import java.time.format.DateTimeFormatter
import javax.swing.text.JTextComponent

// Get the current date as a string
def dateString = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))

// Get the currently focused component
def focusedCom…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@nnako
Comment options

@dpolivaev
Comment options

@nnako
Comment options

@nnako
Comment options

Answer selected by nnako
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants