Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Documentation Function @GETDATE

Jun
1,092
48
The documentation showing the syntax for the new "title" argument is slightly wrong.

@GETDATE[[date][,title]] : Display a calendar dialog and returns the selected date in yyyy-mm-dd format.​

It should be

@GETDATE[[date,][title]] : Display a calendar dialog and returns the selected date in yyyy-mm-dd format.​

A comma should be included only if there is a default date. When the command echo %@getdate[,Choose date:] is issued, the title at the top of the popup is ",Choose date:" (with the leading comma).

The same comment applies for @GETDATETIME.

P. S. This is another of the cases where TCC in a ConPTY tab does not have focus on return. I had to click the mouse in the tab window before I could start typing.
 
The documentation showing the syntax for the new "title" argument is slightly wrong.

@GETDATE[[date][,title]] : Display a calendar dialog and returns the selected date in yyyy-mm-dd format.​

It should be

@GETDATE[[date,][title]] : Display a calendar dialog and returns the selected date in yyyy-mm-dd format.​

A comma should be included only if there is a default date. When the command echo %@getdate[,Choose date:] is issued, the title at the top of the popup is ",Choose date:" (with the leading comma).

It's a little more complicated than that - a comma should only be included if there is a default date, AND you specify a title. That's difficult to explain with a few ['s and ]'s.

P. S. This is another of the cases where TCC in a ConPTY tab does not have focus on return. I had to click the mouse in the tab window before I could start typing.

Not reproducible here.
 
It's a little more complicated than that - a comma should only be included if there is a default date, AND you specify a title. That's difficult to explain with a few ['s and ]'s.

You're right. That is pretty tricky syntax. The function can take a single argument that could be either a default date or the title. I guess that your code looks at the text and treats is as the default date if it fits the format. I guess the only way to present the syntax rigorously would be to show each of the possibilities, including the comma only when two arguments are present.

I did notice that if one quotes a string that is the sole argument, it is treated as the title even if it is in the format of a date. The help could suggest enclosing a title in quotes. Here's an example.

->echo %@getdate["1999-12-12"]​
2026-04-20​

1776712139100.webp


Not reproducible here.

Really. After you select a date and click OK or click the "Close" button, you can enter text at the command prompt. The TCC tab refuses to take text for me until I click the mouse in the window.

Does anyone else see this? Rex, any debugging suggestions? I'm seeing this after returning from many (if not all) pop-up windows.
 
Really. After you select a date and click OK or click the "Close" button, you can enter text at the command prompt. The TCC tab refuses to take text for me until I click the mouse in the window.

Does anyone else see this? Rex, any debugging suggestions? I'm seeing this after returning from many (if not all) pop-up windows.

I have previously reported the same problem as you Jay (see thread here). At the time I was the only person who reported this problem, aside from Vince who saw a similar issue with @GetDate, which Rex was able to fix. The simplest way for me to recreate it was to open and then escape out of a command dialog e.g. using "beep /=".

Rex tried to make some adjustments, and also suggested that maybe something on my machine was intercepting the setfocus call TCMD was making. I could not find anything.

I did a little research and it appears that certain conditions must be met for Windows to allow an app to setfocus to another app or to set the foreground app.

Sounds like you and I are encountering the same issue.
 
Back
Top