Jump to content

Recommended Posts

Posted (edited)

Oh this is nice. How did you get them to persist like that?

EDIT: I've only spent about 10 minutes playing around with this, but I love it. AutoIt has really needed this because there hasn't been a solution yet for Windows 11 that has been able to have the toasts persist in the notification center like this.

Fantastic work. I look forward to watching this progress over time. I definitely can make great use of this.

Edited by WildByDesign
Posted
20 minutes ago, WildByDesign said:

Oh this is nice. How did you get them to persist like that?

Thank you :D My guess is the combination of attributes used, but haven't spend much time on the XML, after i got it somewhat usable :P

22 minutes ago, WildByDesign said:

EDIT: I've only spent about 10 minutes playing around with this, but I love it. AutoIt has really needed this because there hasn't been a solution yet for Windows 11 that has been able to have the toasts persist in the notification center like this.

Glad to hear! :D Yeah in general AutoIt has been missing proper native toasts since the windows 8 overhaul, as far as i know ;)

24 minutes ago, WildByDesign said:

Fantastic work. I look forward to watching this progress over time. I definitely can make great use of this.

Yeah it's a little rough around the edges currently, but i am working towards providing a good implementation little by little :D
Happy to hear it will be used :D

Posted

Hi @genius257Very cool,
I'm not familiar with this stuff, but it looks interesting.
You've done a great job implementing it in AutoIt!
I tried creating some simple test toasts in XML, but not all the tags work correctly at the moment (for example, the <image> tag doesn't display the image if the "src=" parameter is a URL...). Furthermore, it's mandatory to specify the activationType="background" parameter in the initial <toast...> tag...
To generate my test toasts in XML, I installed this app (which also has ready-made templates): https://apps.microsoft.com/detail/9nblggh5xsl1
then, to insert the generated XML code into your example listing in AutoIt, I copy the generated code to the clipboard (select the listing and press Ctrl-C), and immediately run this little script (F5 in SciTE), which adapts it and puts it back in the clipboard. I then paste it into the AutoIt listing.

Local $sVarName = "$sToast"
Local $aStr = StringSplit(ClipGet(), @CRLF, 1) ;  get the clipboard content

Local $sListing ; = "Func " & $sFuntionName & "()" & @CRLF
$sListing &= 'Local ' & $sVarName & ' = ""' & @CRLF
For $i = 1 To $aStr[0]
    $sListing &= $sVarName & ' &= "' & StringReplace($aStr[$i], '"', '""') & '" ' & @CRLF
Next

ClipPut($sListing)
ConsoleWrite($sListing)

This is an example of output (which I later modified a bit) to insert into the example script.

Local $sToast = ""
$sToast &= "<toast activationType=""background"" launch=""action=viewAlarm&amp;alarmId=3"" scenario=""alarm"">"
$sToast &= ""
$sToast &= "  <visual>"
$sToast &= "    <binding template=""ToastGeneric"">"
$sToast &= "      <text>Time to wake up!</text>"
$sToast &= "      <text>To prove you're awake, select which of the following fruits is yellow...</text>"
$sToast &= '      <image placement="appLogoOverride" src="file://' & @TempDir & '\e21cd29c9fb51c3a5b82f009ec33fc997d2edd1ece931e8568f37e205c445778.jpeg" hint-crop="circle"/>'
$sToast &= "    </binding>"
$sToast &= "  </visual>"
$sToast &= ""
$sToast &= "  <actions>"
$sToast &= ""
$sToast &= "    <input id=""answer"" type=""selection"" defaultInput=""wrongDefault"">"
$sToast &= "      <selection id=""wrong"" content=""Orange""/>"
$sToast &= "      <selection id=""wrongDefault"" content=""Blueberry""/>"
$sToast &= "      <selection id=""right"" content=""Banana""/>"
$sToast &= "      <selection id=""wrong"" content=""Avacado""/>"
$sToast &= "      <selection id=""wrong"" content=""Cherry""/>"
$sToast &= "    </input>"
$sToast &= ""
$sToast &= "    <action"
$sToast &= "      activationType=""system"""
$sToast &= "      arguments=""snooze"""
$sToast &= "      content=""""/>"
$sToast &= ""
$sToast &= "    <action"
$sToast &= "      activationType=""background"""
$sToast &= "      arguments=""dismiss"""
$sToast &= "      content=""Dismiss""/>"
$sToast &= ""
$sToast &= "  </actions>"
$sToast &= ' <audio src=''ms-winsoundevent:Notification.Looping.Alarm'' loop=''false''/>'
$sToast &= "</toast>"


.. I hope you can implement support for events too...


Bye and thanks! :)

P.S.
There was a notification "emulator" at this link:: Notifications UDF - Desktop notifications 1.2 (updated Mai 1st) - AutoIt Example Scripts - AutoIt Forums

 

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...