You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to create a python script that sends me a windows toast notification and gives me two buttons, one to postpone, and one to start a backup (powershell script).
I tried multiple libraries, like winotify, win10toast, but settled on win11toast.
defon_postpone():
print("Postponed")
print(f"starting Backup notification")
ps_script=os.path.join(user_folder, 'Pictures', 'Backup_Starter.ps1')
buttons= [
{'activationType': 'protocol', 'arguments': f'{ps_script}', 'content': 'Start Backup'},
{'activationType': 'protocol', 'arguments':'', 'content': 'Postpone Backup'}
]
# send toasttoast(
"Script Ready to Start",
f"Click 'Start Script' to start, or 'Postpone' to postpone the Backup.",
duration="long",
buttons=buttons,
audio='ms-winsoundevent:Notification.Looping.Alarm'
)
# if Nothing clickedprint("Postponing the script...")
on_postpone()
While this kinda works, I cannot find a way to make the Start Backup button start the powershell script, it does just open in notepad and also I cannot find a way to execute on_postpone always, except it there was a click on Start Backup.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi
I'd like to create a python script that sends me a windows toast notification and gives me two buttons, one to postpone, and one to start a backup (powershell script).
I tried multiple libraries, like winotify, win10toast, but settled on win11toast.
While this kinda works, I cannot find a way to make the Start Backup button start the powershell script, it does just open in notepad and also I cannot find a way to execute on_postpone always, except it there was a click on Start Backup.
Thanks!
The text was updated successfully, but these errors were encountered: