Post your working scripts, libraries and tools.
-
XMCQCX
- Posts: 258
- Joined: 14 Oct 2020, 23:44
Post
by XMCQCX » 06 May 2024, 17:20
Notify
This class makes it easier to create and display notification GUIs.
Features
- Change text, font, color, image, animation.
- Rounded or edged corners.
- Position at different locations on the screen.
- Multi-Monitor support.
- Multi-Script support. Finds all GUIs from all scripts and positions them accordingly.
- Play a sound when it appears.
- Call a function when clicking on it.
Inspired by the
Automator Notify Class and the original
Notify function by gwarble. I attempted to modify it. However, I struggled to comprehend the code, so I created my own version.
For the latest version of this script, documentation and examples, head over to the GitHub page.
Download on GitHub
![Image](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYnVnbHFqNHdmNmgwOTRxMmg1dDA2MnlicW9rc3d0ZWVsNXQzNTdrZSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/PzPnSO7GoAlfFH5deh/giphy.gif)
Last edited by
XMCQCX on 12 Jun 2024, 09:00, edited 10 times in total.
-
songdg
- Posts: 628
- Joined: 04 Oct 2017, 20:04
Post
by songdg » 06 May 2024, 22:19
Wonderful, thanks for sharing
![Clapping :clap:](./images/smilies/icon_clap.gif)
-
reddyshyam
- Posts: 55
- Joined: 24 Jul 2023, 04:34
Post
by reddyshyam » 07 May 2024, 10:49
Hi
@XMCQCX ,
Thanks for this, much appreciated! I have been using a wonderful script WiseGUI which is just brilliant and I love it. I noticed that WiseGUI lacks html support but it was not a problem at all
Will try to use your lib just for thrill of it and change where ever I would want sound notifications and html content.
It would be nice to show some screenshots too so that we know what we get before we start using it.
![Smile :)](./images/smilies/icon_e_smile.gif)
Hope this is ok.
-
XMCQCX
- Posts: 258
- Joined: 14 Oct 2020, 23:44
Post
by XMCQCX » 07 May 2024, 14:26
reddyshyam wrote: ↑07 May 2024, 10:49
It would be nice to show some screenshots too so that we know what we get before we start using it.
![Smile :)](./images/smilies/icon_e_smile.gif)
Hope this is ok.
Hi
@reddyshyam. Thanks for the suggestion! I’ve updated my post with screenshots.
-
kczx3
- Posts: 1649
- Joined: 06 Oct 2015, 21:39
Post
by kczx3 » 09 May 2024, 08:20
XMCQCX wrote: ↑07 May 2024, 14:26
reddyshyam wrote: ↑07 May 2024, 10:49
It would be nice to show some screenshots too so that we know what we get before we start using it.
![Smile :)](./images/smilies/icon_e_smile.gif)
Hope this is ok.
Hi @reddyshyam. Thanks for the suggestion! I’ve updated my post with screenshots.
You did?
-
XMCQCX
- Posts: 258
- Joined: 14 Oct 2020, 23:44
Post
by XMCQCX » 10 May 2024, 08:10
Updated to 1.1.0
- Added a new parameter for destroying currently existing GUIs or not when a new GUI is created.
- Added a GUI to list and hear all the available sounds. Call Notify.SoundsList()
- Sound parameter. Allow using 'Windows Ding', for instance, instead of Notify.mSounds['Windows Ding'].
-
Delta Pythagorean
- Posts: 628
- Joined: 13 Feb 2017, 13:44
- Location: Somewhere in the US
-
Contact:
Post
by Delta Pythagorean » 13 May 2024, 16:02
Instead of having 18 parameters for one function, needing to remember the position for each one, why not use an object to pass individual parameters?
Code: Select all
Notify.Show({ body_text: "Lorem ipsum", icon: "x", style: "round", duration: 5 * 1000 })
-
XMCQCX
- Posts: 258
- Joined: 14 Oct 2020, 23:44
Post
by XMCQCX » 15 May 2024, 05:58
@Delta Pythagorean I weighed the pros and cons of passing a single object versus passing multiple parameters and hesitated about which one to choose. Ultimately, I chose individual parameters because the thqby v2 language support extension has intelligent prompts for function parameters, which allow a user to see the parameter when typing. However, you are right that using 18 parameters is not optimal. I will probably update it in the next few days to be similar to the original notify v1 by gwarble, in this format:
Code: Select all
Notify.Show('Title text', 'Message Text', 'iconi', 'soundx',, 'TS=35 POS=TL DUR=8 DG=2')
Last edited by
XMCQCX on 18 May 2024, 17:06, edited 1 time in total.
-
XMCQCX
- Posts: 258
- Joined: 14 Oct 2020, 23:44
Post
by XMCQCX » 18 May 2024, 15:51
Updated to 1.2.0
WARNING! This version introduces BREAKING CHANGES if GUIs were created using the previous versions.
- Reduced number of parameters from 18 to 6.
- Added methods for destroying GUIs.
- Added center positioning.
- Added animate window duration option.
- Duration option now in seconds instead of milliseconds.
- Added JSDoc documentation.
-
XMCQCX
- Posts: 258
- Joined: 14 Oct 2020, 23:44
Post
by XMCQCX » 31 May 2024, 20:03
Updated to 1.3.0
- Added an option to choose the animation when showing and hiding the GUI, such as fade, slide, roll etc. Only the fade animation is rendered correctly with the round style.
- Removed the AWD (Animation Window Duration) option and replaced it with SHOW and HIDE options inspired by WiseGui by @SKAN. The new format is 'STYLE=EDGE SHOW=Fade@125 HIDE=SlideEast@500'.
- Fixed the "Gui has no window" bug when using the DG (Destroy GUIs) option.
- Added options for message alignment and border.
-
wjt936826577
- Posts: 6
- Joined: 11 Jun 2023, 07:54
Post
by wjt936826577 » 04 Jun 2024, 09:56
Great program, but because of the static methods and properties used, when I create a window that is not closed, it becomes difficult to programmatically close it, I don't know if there is a solution
-
XMCQCX
- Posts: 258
- Joined: 14 Oct 2020, 23:44
Post
by XMCQCX » 04 Jun 2024, 17:12
wjt936826577 wrote: ↑04 Jun 2024, 09:56
it becomes difficult to programmatically close it, I don't know if there is a solution.
In this version (1.3.0), it’s not possible to programmatically close a specific GUI; you can only destroy all GUIs or destroy all GUIs at a specific position. I’ve included a method to close a specific GUI in my test version. It will most likely be included in the next update.
-
wjt936826577
- Posts: 6
- Joined: 11 Jun 2023, 07:54
Post
by wjt936826577 » 04 Jun 2024, 20:00
XMCQCX wrote: ↑04 Jun 2024, 17:12
wjt936826577 wrote: ↑04 Jun 2024, 09:56
it becomes difficult to programmatically close it, I don't know if there is a solution.
In this version (1.3.0), it’s not possible to programmatically close a specific GUI; you can only destroy all GUIs or destroy all GUIs at a specific position. I’ve included a method to close a specific GUI in my test version. It will most likely be included in the next update.
good job!
-
wjt936826577
- Posts: 6
- Joined: 11 Jun 2023, 07:54
Post
by wjt936826577 » 05 Jun 2024, 07:26
SHOW=SLIDEWEST,When it slides out, there is a white window at first
-
wjt936826577
- Posts: 6
- Joined: 11 Jun 2023, 07:54
Post
by wjt936826577 » 05 Jun 2024, 08:26
It is recommended set dur as a separate parameter, because the duration parameter is usually passed by program
-
wjt936826577
- Posts: 6
- Joined: 11 Jun 2023, 07:54
Post
by wjt936826577 » 06 Jun 2024, 07:40
'i)(\w+)=((?:.*?)(?=\s+\w+=|$))',The regular expression in the program can be simplified to 'i)(\w+)=(.*?(?=\s+\w+=|$))'
-
XMCQCX
- Posts: 258
- Joined: 14 Oct 2020, 23:44
Post
by XMCQCX » 06 Jun 2024, 19:46
wjt936826577 wrote: ↑05 Jun 2024, 06:35
Why can you show pictures, don't you only show ICONS
What do you mean?
wjt936826577 wrote: ↑06 Jun 2024, 07:40
'i)(\w+)=((?:.*?)(?=\s+\w+=|$))' The regular expression in the program can be simplified to 'i)(\w+)=(.*?(?=\s+\w+=|$))'
Thanks, I’ve modified it in my test version. I will probably release the next update next week. I’ve added multi-monitor support, multi-script stacking, and other options.
-
XMCQCX
- Posts: 258
- Joined: 14 Oct 2020, 23:44
Post
by XMCQCX » 12 Jun 2024, 08:58
Updated to 1.4.1
- Added Multi-Monitor support.
- Added Multi-Script support. Finds all GUIs from all scripts and positions them accordingly.
- New methods:
- For closing GUIs (Single GUI, all GUIs etc.)
- MonitorGetInfo() - Displays information about the monitors connected to the system.
- New options:
- MON - Monitor number to display the GUI.
- PADX - The space between the left or right edge of the GUI and the edge of the screen.
- PADY - The space between the top or bottom edge of the first GUI created at a postion and the edge of the screen.
- MFO - Message font options.
- TFO - Title font options.
- TALI - Title alignment.
- MALI - Message alignment.
- WSTC - WinSetTransColor.
- WSTP - WinSetTransparent.
- DGC - Allow or prevent the GUI from being destroyed when clicked.
- DGA
- Breaking changes if they were used in the previous version:
- ALI - Removed and replaced with TALI and MALI.
- The Show method now returns a map object rather than just a handle (hwnd).
-
fenchai
- Posts: 295
- Joined: 28 Mar 2016, 07:57
Post
by fenchai » 14 Jun 2024, 15:59
I think adding a tag option or parameter is a good idea to avoid duplicated notifications.
for example I am using Notify to show toggle state of CAPSLOCK, if I tap is fast it will show a lot of notifies, better to use a tag and let the class handle duplicated tags. So in recap, even if I am spamming CAPSLOCK it should just know that there is a duplicated tag and will remove the old one before showing the new one.