FUNCTION = TODAY

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
feliperrds
Posts: 8
Joined: 25 Mar 2019, 07:52

FUNCTION = TODAY

25 Mar 2019, 08:04

Hello to everyone

I need some help to do a function, i need takes a date in a site and compare with the atual date, but every day i need change manually the date.
i need a function that make it auto, "if clipboard = today" but i dont know how to do.

Code: Select all

Until ErrorLevel = 0
        Click, 492, 242 Left, Down
        Sleep, 100
        Sleep, 100
        Click, 436, 243 Left, Up
       Sleep, 10
        Send, {LControl Down}{c}{LControl Up}
        Sleep, 500
       [b] If Clipboard = 25/03/2019[/b]
        {
            SoundBeep, 1500, 500
            SoundBeep, 1500, 500
            SoundBeep, 1500, 500
            SoundPlay, C:\Users\CIELO\Music\V NO DIA.wma
            Sleep, 3000
        }
        Loop, 100000
feliperrds
Posts: 8
Joined: 25 Mar 2019, 07:52

Re: FUNCTION = TODAY

25 Mar 2019, 08:20

i know that is simple but i dont know how to do, If Clipboard = actual date dd/mm/yyyy (today)
User avatar
Scr1pter
Posts: 1277
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: FUNCTION = TODAY

25 Mar 2019, 08:25

Hi and welcome,

This works for me:

Code: Select all

F1::
if Clipboard = %A_DD%/%A_MM%/%A_YYYY%
{
  MsgBox, Yes, it's today!
}
return
You can probably use some additional function to format it, rather than using 3 variables (as I did).
See this section for more information:
https://www.autohotkey.com/docs/Variables.htm#DDDD

Cheers!
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
User avatar
Tigerlily
Posts: 377
Joined: 04 Oct 2018, 22:31

Re: FUNCTION = TODAY

25 Mar 2019, 08:27

Try throwing this in there:

Code: Select all

Clipboard := ""
SendInput, ^c
ClipWait
Sleep, 500
If Clipboard = %A_DD%/%A_MM%/%A_YYYY%
	MsgBox Date Found
else
	MsgBox Date Not Found
Last edited by Tigerlily on 25 Mar 2019, 11:21, edited 2 times in total.
-TL
feliperrds
Posts: 8
Joined: 25 Mar 2019, 07:52

Re: FUNCTION = TODAY

25 Mar 2019, 08:29

thank you!!!
just me
Posts: 9495
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: FUNCTION = TODAY

25 Mar 2019, 10:41

Tigerlily wrote:
25 Mar 2019, 08:27

Code: Select all

...

If (Clipboard = %A_DD%/%A_MM%/%A_YYYY%)
	...
That does not work (wrong usage of %-signs in an expression).
User avatar
Tigerlily
Posts: 377
Joined: 04 Oct 2018, 22:31

Re: FUNCTION = TODAY

25 Mar 2019, 11:24

just me wrote:
25 Mar 2019, 10:41
Tigerlily wrote:
25 Mar 2019, 08:27

Code: Select all

...

If (Clipboard = %A_DD%/%A_MM%/%A_YYYY%)
	...
That does not work (wrong usage of %-signs in an expression).
Woops I was v tired when I posted that :lol: thanks for pointing that out

Correct usage:

Code: Select all

Clipboard := ""
SendInput, ^c
ClipWait
Sleep, 500
if (Clipboard = A_DD "/" A_MM "/" A_YYYY)
	MsgBox Date Found
else
	MsgBox Date Not Found
-TL

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Spawnova and 121 guests