Date Stamp with GUI Script

Share your favorite FastKeys commands
Post Reply
big-red
Posts: 3
Joined: Sep 6th, ’14, 05:55

Post by big-red » Sep 6th, ’14, 06:10

Hi folks,

I tried the trial version of FastKeys a few weeks ago. Didn't take me long to purchase this great programme. Just what I'm looking for.

A question.

I use date stamps on my documents using the excellent AutoHotkey script and the bottom of this post.

Sometimes I use variations on the date format yyyyMMdd or ddMMyyyy.

I can run the script in FastKeys as a command (removing the !^d:: keystroke command, as this is already covered in FastKeys).

When I make a few duplicate shortcuts with my date variants, I allocate them different shortcut keys, and different names, but they always produce the same date format result.

I've found that whichever script is uppermost in the 'shortcuts' menu, that script is used. I've proved this by swapping the order of the shortcuts.

Anybody have an idea why this might be happening? It's been my only FastKeys fustration so far.

!^d::
Gui, Add, MonthCal, vDayPick
Gui, Add, Button, Default, Submit
Gui, Show
return

ButtonSubmit:
Gui, Submit
FormatTime, DayPick, %DayPick%, MMMM d, yyyy
Send, %DayPick%
Gui, Destroy
return
User avatar
Marko
Posts: 1718
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Sep 7th, ’14, 01:13

Hi and welcome to the forum. I think the issue might be that you use the same label name in your duplicated shortcuts. Try renaming the labels in duplicates to ButtonSubmit1, ButtonSubmit2 etc.

Let me know if this helps.
big-red
Posts: 3
Joined: Sep 6th, ’14, 05:55

Post by big-red » Sep 7th, ’14, 03:45

Hi Marko

Thanks for your reply - If you mean the second field from the top when editing the shortcut named 'description', then they definitely have different names.

Is this what you meant?
User avatar
Marko
Posts: 1718
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Sep 7th, ’14, 10:44

What I meant is to change the first duplicate command field (script) to:

Gui, Add, MonthCal, vDayPick
Gui, Add, Button, Default, Submit1
Gui, Show
return

ButtonSubmit1:
Gui, Submit
FormatTime, DayPick, %DayPick%, MMMM d, yyyy
Send, %DayPick%
Gui, Destroy
return

(Changes in bold). In the next duplicate, change it to Submit2 and ButtonSubmit2 and so on...
big-red
Posts: 3
Joined: Sep 6th, ’14, 05:55

Post by big-red » Sep 7th, ’14, 12:14

Now works perfectly.

I see I'm going to have to learn some ahk scripting.

Thanks Marko for your help / prompt replies.
ryangallagher
Posts: 1
Joined: Aug 8th, ’16, 20:11

Post by ryangallagher » Aug 8th, ’16, 20:17

Would it be possible to use a custom date-time script or a script that can create a folder with the format "YYMMDD-HHMM" of the moment I am creating the folder is that possible. Or a string that would replace on complete.
User avatar
Marko
Posts: 1718
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Aug 9th, ’16, 23:31

yes, easy. Create a shortcut (or any other module), Type: Command

Code: Select all

FormatTime, MyDate, , yyMMdd-HHmm
FileCreateDir, % MyDate
Msgbox, Folder %MyDate% created.
https://autohotkey.com/docs/commands/FormatTime.htm
Post Reply