Rank: Member
Groups: Approved
Joined: 12/2/2019(UTC) Posts: 21
Thanks: 2 times
|
Hi how do I create a text expansion which will insert the current date or time? I could not find any syntax about that. Edited by user Sunday, December 3, 2023 6:51:58 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,382 Location: Tampa, FL Thanks: 28 times Was thanked: 430 time(s) in 363 post(s)
|
Try this - select Automation for the Method, then the Script tab: Code:var d = new Date();
sp.SendString(`${d.getFullYear()}-${("0"+(d.getMonth()+1)).slice(-2)}-${("0"+d.getDate()).slice(-2)} `
+ `${("0"+d.getHours()).slice(-2)}:${("0"+d.getMinutes()).slice(-2)}`);
|
|
|
|
Rank: Member
Groups: Approved
Joined: 12/2/2019(UTC) Posts: 21
Thanks: 2 times
|
Thank you
but for some reason it works every other time
|
|
|
|
Rank: Member
Groups: Approved
Joined: 8/31/2021(UTC) Posts: 13 Thanks: 1 times
|
Originally Posted by: Rob Try this - select Automation for the Method, then the Script tab: Code:var d = new Date();
sp.SendString(`${d.getFullYear()}-${("0"+(d.getMonth()+1)).slice(-2)}-${("0"+d.getDate()).slice(-2)} `
+ `${("0"+d.getHours()).slice(-2)}:${("0"+d.getMinutes()).slice(-2)}`);
Thanks for the script, very useful. I'd been looking for something like this, I used to be able to do it via PhraseExpress software, but am no longer using it.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close