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

    • 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.
    • dwaynek
      By dwaynek
      traytip isn't working in windows 10. nothing happens when i use the Traytip command.
      here's a simple script i used:
      TrayTip("I'm a title", "I'm the message", 5) i tried changing the registry setting HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced ( which didn't have EnableBalloonTips) and creating a DWORD entry called EnableBalloonTips and setting it to 1 and logging off then back in. that did not resolve the problem.
      i'm running Windows 10 v1709 b16299.431
    • user4157124
      By user4157124
      As they're opinion-based to some degree; how are AutoIt's best practices decided and do suggestions get considered?
      Some suggestions :
      For...To...Step...Next -loop variable-naming like $iN ($i1, $i2, etc.) : conforms to recommended naming convention, identifies level (albeit inverted to ExitLoop and ContinueLoop's convention) and enables SciTE selection-highlighting (requires minimum of 3 characters). Minimize logic in global scope, separate data & settings from logic, use of vertical space, project organization (folder structure, resource- and include file management). Example (loop variable-naming, minimizing logic in global scope and separation of settings from logic) :
      #include <Array.au3> Global Enum $RANDOM_RETURNFLOAT, _ $RANDOM_RETURNINTEGER Global Enum $EXITCODE_NONE Global Const $g_sChar0 = '-' Global Const $g_sChar1 = '+' Global Const $g_iAmountX = 10 Global Const $g_iAmountY = $g_iAmountX Main() Func Main() Local $aArray[$g_iAmountY][$g_iAmountX] For $i1 = 0 To $g_iAmountY - 1 For $i2 = 0 To $g_iAmountX - 1 $aArray[$i1][$i2] = Random(0, 1, $RANDOM_RETURNINTEGER) ? $g_sChar1 : $g_sChar0 Next Next _ArrayDisplay($aArray) Exit $EXITCODE_NONE EndFunc Example (project organization) :
      + project_folder + bak [backup files] + bin [distributed binaries and dependencies] + inc [non-standard include files] + res [resource files (icons, file+install files, etc.)] + usr [configuration files, databases, etc.] - script.au3 - script.exe Example (use of vertical space) :
      Func _DigitalRoot($iNum) Local $sNum = '' Local $aNum While $iNum > 9 $sNum = String($iNum) $aNum = StringSplit($sNum, '') $iNum = 0 For $i1 = 1 To $aNum[0] $iNum += Int($aNum[$i1]) Next WEnd Return $iNum EndFunc
    • AppSoftwareVld
      By AppSoftwareVld
      Hello,
       
      I need this for a project and I don't find a method for the next problem.
      I want when I click a button to create a variable ("$variable1") so if I press one more time to create one more ("$variable2") and create more and more how many times you press the button.
       
      Do you have an idea ? 
      Thank you for your attention !
×