I am writing an app that will be used to copy large numbers of photos (often tens of thousands at a time) from SD cards to external hard drives, which people will be running in the background while they do other work. I want to notify the user when the file copying is finished so they don't have to keep checking the app. I have used shinyalert()
in the past, and I am also aware of using javascript functions to send alerts as well (this is the one I found:
$( document ).ready(function() {
Shiny.addCustomMessageHandler('alert', function(message) {
alert(message)
})
});
). But, those only appear when the app is open, and I want something that will pop up in front of any other windows. My solution was to use system2()
to call a powershell script, which I borrowed from this page: https://gist.github.com/Windos/9aa6a684ac583e0d38a8fa68196bc2dc#file-toast-notification-not-working-on-windows-fall-creators-update-ps1 and changed the actual text of the alert.
The powershell script works well, but I'm worried that it won't work if the user has a different version of Windows. (The app is intended to be deployed as a package and run locally off the user's computer, rather than run from a shiny server).
Are there any options or settings in shinyalert or javascript alerts that I can change to make them visible in front of other windows? And/or is the powershell script option robust enough that it would work on different computers?
Thanks!