Get a TrayTip whenever your script is reloaded

Post your working scripts, libraries and tools for AHK v1.1 and older
aph
Posts: 7
Joined: 29 Jan 2018, 21:53

Get a TrayTip whenever your script is reloaded

06 Feb 2018, 19:21

Code: Select all

; Description: Get a TrayTip whenever your script is reloaded
; Permalink: https://autohotkey.com/boards/viewtopic.php?t=43865
; Author: aph
; Version: 0.1
FileGetAttrib, attribs, %A_ScriptFullPath%
if (attribs="A") {
   FileSetAttrib, -A, %A_ScriptFullPath%
   TrayTip, Reloaded script, %A_ScriptFullPath%,, 1
}
OnExit, ExitSub
Return
ExitSub:
   if (A_ExitReason="Reload") {
       FileSetAttrib, +A, %A_ScriptFullPath%
   }
ExitApp
For example, works well with:

Code: Select all

; Alt+Shift+R to reload AutoHotkey script
+!r::Reload
Last edited by aph on 11 Feb 2018, 08:39, edited 2 times in total.
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: Get a tray tooltip whenever your script is reloaded

07 Feb 2018, 02:10

whats you question?
you want a "tray tooltip" ?
aph
Posts: 7
Joined: 29 Jan 2018, 21:53

Re: Get a tray tooltip whenever your script is reloaded

08 Feb 2018, 19:47

No question. I corrected "tray tooltip to clarify that this code gives you a TrayTip whenever the Reload command is issued.

Normally this would not be possible since since AHK is reloading, removing all its widgets.

By temporarily toggling the archive attribute on the currently running script when it exits due to a reload, we can issue a TrayTip when it loads again.
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: Get a TrayTip whenever your script is reloaded

12 Feb 2018, 04:24

Why modify the file's attributes?

You can detect whether the script was reloaded by looking at its command line.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 148 guests