Is it possible to generate system notifications instead of using script logs from Soundflow?
Linked from:
- Christian Scheuer @chrscheuer2021-02-19 14:58:25.839Z
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.- Christian Scheuer @chrscheuer2021-02-19 15:00:27.423Z
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.
- Christian Scheuer @chrscheuer2021-02-19 15:02:32.153Z
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` }); }
- Dustin Harris @Dustin_Harris
Whaaaaaaatttt?! This is incredible!
- In reply tochrscheuer⬆:RRob Byers @Rob_Byers
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` }); }
- samuel henriques @samuel_henriques
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()
- RRob Byers @Rob_Byers
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.
- NNacho @Nacho_Sotelo
I'm using IFTTT to get push notifications on my phone, you can create a webhook and call it from soundflow.
- RRob Byers @Rob_Byers
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...)
- NNacho @Nacho_Sotelo
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 :)
- RRob Byers @Rob_Byers
I can't wait to give this a go this evening. Thank you very, very much.
- In reply toNacho_Sotelo⬆:Christian Scheuer @chrscheuer2021-03-11 23:06:33.783Z
Wow, thanks for sharing, Nacho!