No internet connection
  1. Home
  2. How to

Notifications in Soundflow vs system notifications

By Andrew Sherman @Andrew_Sherman
    2021-02-19 14:32:07.963Z

    Is it possible to generate system notifications instead of using script logs from Soundflow?

    Solved in post #2, click to view
    • 14 replies
    1. Hi Andrew,

      Currently, no. We originally used system notifications, but due to the way they're implemented in macOS this causes a lot of issues. For example, if SoundFlow is in the foreground, macOS hides system notifications coming from SoundFlow leading to users not getting the feedback they expect.
      By using our own notifications we have full control over when they're displayed leading to fewer bad experiences for end users.

      ReplySolution
      1. Note, you may be able to use an AppleScript inside SoundFlow to make system notifications - something like this:

        sf.system.execAppleScript({
            script: `
            display notification "Lorem ipsum dolor sit amet" with title "Title"    
            `
        });
        

        But it will show Script Editor as the app sending the notification, and it has all the downsides of system notifications as I mentioned above.

        1. Please note, we also have support for alert('Test') for blocking notifications.

          Some other things you can do - use the Messages app to send yourself a text :)

          function sendTextMessage() {
              sf.system.execAppleScript({
                  script: `
                  tell application "Messages"
                      send "${messageText}" to buddy "${recipientPhoneNumber}" of service "E:${senderIcloudEmail}"
                  end tell`
              });
          }
          
          1. Dustin Harris @Dustin_Harris
              2021-02-19 15:05:01.082Z

              Whaaaaaaatttt?! This is incredible!

              1. In reply tochrscheuer:
                AAndrew Sherman @Andrew_Sherman
                  2021-02-19 15:13:44.199Z

                  Very cool!

                  1. In reply tochrscheuer:
                    RRob Byers @Rob_Byers
                      2021-03-11 03:42:34.266Z

                      Christian, would you be willing to troubleshoot the Messages app code a bit? I'm trying what you provided, but nothing seems to happen. I want to use this at the end of a long string of commands (which may take up to 15 minutes to execute) to alert me in case I'm away from my computer.

                      I've tried it with Messages app open and closed.

                      Here's what I've used so far:

                      function sendTextMessage() {
                          sf.system.execAppleScript({
                              script: `
                              tell application "Messages"
                                  send "${Soundflow is done}" to buddy "${+12223334444}" of service "E:${myicloudemail@gmail.com}"
                              end tell`
                          });
                      }
                      
                      1. samuel henriques @samuel_henriques
                          2021-03-11 09:25:30.417Z

                          Hello @Rob_Byers,
                          try this:

                          function sendTextMessage() {
                          
                          const messageText = "Soundflow is done"
                          const recipientPhoneNumber = "+12223334444"
                          const senderIcloudEmail = "myicloudemail@gmail.com"
                          
                          
                              sf.system.execAppleScript({
                                  script: `
                                  tell application "Messages"
                                      send "${messageText}" to buddy "${recipientPhoneNumber}" of service "E:${senderIcloudEmail}"
                                  end tell`
                              });
                          }
                          
                          
                          sendTextMessage() 
                          
                          1. RRob Byers @Rob_Byers
                              2021-03-11 13:40:33.913Z2021-03-11 13:58:29.552Z

                              Thank you very much! This works. Woot!

                              Now... being on iOS, when the text is sent (from myself to myself), my phone does not present a notification. Going down rabbit holes to figure that out. I'm wondering if I'm going to need to use some third-party notification service.

                              Really, I don't need a text, I just want a push notification of some kind to the phone.

                              1. NNacho @Nacho_Sotelo
                                  2021-03-11 18:19:01.207Z

                                  I'm using IFTTT to get push notifications on my phone, you can create a webhook and call it from soundflow.

                                  1. RRob Byers @Rob_Byers
                                      2021-03-11 19:20:21.259Z

                                      I love this community. Nacho, I read your reply over lunch and started looking at IFTTT. Just a few minutes I searched Soundflow for "IFTTT" and found your tutorial post that you just made, what, 20 minutes ago? Thank you!

                                      (I hope I'm not stealing your thunder...)

                                      1. NNacho @Nacho_Sotelo
                                          2021-03-11 19:22:51.349Z

                                          Awesome! Yes, I wrote that tutorial right after reading your comment, figured a lot of people can benefit from this. I hope you find it useful :)

                                          1. RRob Byers @Rob_Byers
                                              2021-03-11 19:24:24.689Z

                                              I can't wait to give this a go this evening. Thank you very, very much.

                                              1. In reply toNacho_Sotelo:

                                                Wow, thanks for sharing, Nacho!

                                                1. In reply toNacho_Sotelo:
                                                  AAndrew Sherman @Andrew_Sherman
                                                    2021-03-12 09:28:59.298Z

                                                    Excellent work!