Jump to content
CurtimusPrime

TrayTip and having variables as text?

Recommended Posts

CurtimusPrime
#include <Date.au3>
#include <TrayConstants.au3>

HotKeySet("^d", "WhatIsToday")

Global $Today = _Date_Time_GetSystemTime

While 1
    Sleep(100)
WEnd

Func WhatIsToday()
    TrayTip("Today's date", "Today is... " & $Today, 8)
    Sleep(8000)
    TrayTip("", "", 0)
EndFunc   ;==>WhatIsToday

all it outputs into tray bubble is:  Today is...

without getting the system time as text

Share this post


Link to post
Share on other sites
Synapsee

u need read more about _Date_Time_GetSystemTime() :

#include <Date.au3>
#include <TrayConstants.au3>

HotKeySet("^d", "WhatIsToday")

Global $Today = _Date_Time_GetSystemTime()

While 1
    Sleep(100)
WEnd

Func WhatIsToday()
    TrayTip("Today's date", "Today is... " & _Date_Time_SystemTimeToDateTimeStr($Today), 8)
    Sleep(8000)
    TrayTip("", "", 0)
EndFunc   ;==>WhatIsToday

 

  • Like 1

Share this post


Link to post
Share on other sites
CurtimusPrime

that returns: Today is...  (time and date format with all 0's)

Share this post


Link to post
Share on other sites
CurtimusPrime

you're right i wasn't reading everything.. i didn't know how to use UDF properly lol... sure don't make them easy lol

Edited by CurtimusPrime

Share this post


Link to post
Share on other sites
Synapsee

be carefull to that :

Global $Today = _Date_Time_GetSystemTime() ;<========= don't fortget parenthese here "()"

without "()" i have your issue :

Quote

(time and date format with all 0's)

 

  • Like 1

Share this post


Link to post
Share on other sites
CurtimusPrime

seems being on vista i cant use AutoIt system time functions

Share this post


Link to post
Share on other sites
Synapsee

that can maybe help :

#include <Date.au3>
#include <MsgBoxConstants.au3>

MsgBox($MB_SYSTEMMODAL, '', "The Date is:   " & _NowDate() & "   " & _NowTime())

 

Edited by Synapsee
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • CarlD
      By CarlD
      Is there a reliable way to ensure that data assigned to variables in a script is overwritten or deleted when the script exits? I have scripts that encrypt/decrypt data and would like to ensure, if possible, that the encryption keys and decrypted data do not stay in memory after the script exits. Thanks.
    • Skeletor
      By Skeletor
      Hi Guys,
      Is it possible to get a variable on your For..Next loop? 
       
      Local $Lines1 = _FileCountLines(C:\temp\test.txt) Local $linesToCount2 = $Lines1 + 2 $var = Number($linesToCount2) For $count = 1 To _FileCountLines($FileRead2) Step 1 For $i = $var To $count Next ;Code does stuff here Next Somehow my code doesn't work even though I thought I could convert the variable to a Integer / Number.
      This code I posted above does not move to the next value.
      But the code below does... why is that?
      For $count = 1 To _FileCountLines($FileRead2) Step 1 For $i = 2 To $count Next ;Code does stuff here Next  
      Why is the For loop resetting itself?
      Is it because the program does not cache the variable and needs to keep on acquiring this variable each time?
      If so , how would you make this variable static?

       
    • ShakeelAhmad
      By ShakeelAhmad
      I've to upload different number of photos online in different assignments. There is a problem that all photos cannot be selected at once to upload. I have to choose and upload photos one by one. For this purpose I have made a script to automate whatever I have to do manually for choosing and uploading photos one by one.
      Please see my script below and check the last "MouseClick" command. This command clicks the button to choose and upload next photo. The problem I'm facing is; the last "MouseClick" works 1 step extra when all photos have been selected and uploaded. I mean if 7 photos are to be uploaded, this command opens the box from where next photo is selected and uploaded then it again opens the box and next photo is choosen and so on.... when last photo is selected and uploaded, this button once again opens the box. When all photos are uploaded, it should not click the button to select next photo. Please suggest how can I resolve this issue.
      #include <AutoItConstants.au3> Sleep(200) HotKeySet("{ESC}","Quit") ;Press ESC key to quit Send("{ALT DOWN}") Send("{TAB}") Send("{ALT UP}") Sleep(200) Local $photos = InputBox("Question", "How many photos to upload?", "#", "", _ - 1, -1, 0, 0) ; How many photos to upload Local $selector = 0 While $photos <> $selector MouseClick("Left", 281, 238, 1) ; mouse click on very first photo in the box. if $selector = 0 Then Send("{ENTER}") ; for selecting very first photo from "open" window. Sleep(800) Else sleep(200) Send("{RIGHT " & $selector & "}") ; for selecting 2nd to onward photos from "open" window. sleep(1000) Send("{ENTER}") sleep(1000) EndIf MouseClick("Left", 495, 198, 1) ; for clicking a button to choose next photo to upload $selector = $selector + 1 WEnd Beep(1500, 300) ; beep when all photos uploaded Exit Regards,
       
      Shakeel
    • Blueman
      By Blueman
      Hey all,

      I have a question about the Windows-10 Traytips and how to assign a function on them.
      So the Traytip will be displayed and when i click it i would like to run a function.
       
      Currently i am looking at the following Topic; https://www.autoitscript.com/forum/topic/140699-tray-notifications-redirector/

      Tried it and it works fine, but now all my TrayTIps are clickable to the same function.
      Is it possible to read the Traytip name and then run a function according to what tip is showing?
       
      Thanks  
    • Gringo
      By Gringo
      Hi,
      I'm trying to create a shortcut playing with variables but I can't figure out what's wrong
      I got 2 variables joined in one with for instance
      Local $path = FileOpenDialog($message, "C:" & "", "Select your executable (*.exe)", 1 + 4)
      Local $elev = 'c:\windows\System32\cmd.exe /c start "runhigh" /high '
      $target = $elev & $path
      FileCreateShortcut($target, @DesktopCommonDir & "\linked.lnk", StringLeft($target,StringInStr($target,"\",0,-1)) , "" , "" , "c:\i.ico")
      The problem is that a shortcut is created but instead of the target area I got the start in filled with my variable
      My second problem is that when I do a shell execute of the result of $target = $elev & $path, Note that if I do a batch with the variable written manually, it's working.
×