Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

J.A.K.

macrumors regular
Original poster
Sep 27, 2023
136
264
I'm ASD/ADHD and find the pink/brown noise from Background Sounds helps with concentration. However I also find turning the sound off and on to be annoying as it requires multiple clicks on most devices. I'm not very good with programming-type things so can't figure out how to create a Shortcut to turn Background Sounds on/off. Is this even possible?

Any help would be much appreciated.

NOTE: I chose iOS as the prefix only because posting required choosing a prefix. I'm hoping this one Shortcut will work on all my Apple devices (iPhone/iPad/MBA).
 

arw

macrumors 65816
Aug 31, 2010
1,092
857
This Shortcut toggles 'Background Sounds' on/off.

@ all: Is there any privacy related reason not to post complete Shortcuts (zipped) here? Like the one below (created by me).
Or is it more of a security concern for those importing/executing them without understanding their functionality?
 

Attachments

  • Toggle-Background-Sounds.png
    Toggle-Background-Sounds.png
    184.6 KB · Views: 112
  • Toggle-Background-Sounds.shortcut.zip
    12.7 KB · Views: 81
Last edited:
  • Like
Reactions: J.A.K.

J.A.K.

macrumors regular
Original poster
Sep 27, 2023
136
264
Thanks but I'm not understanding how this is working and so can't get it to work.

Like, where is it supposed to 'get file' on my Mac or iPhone and what file is supposed to get? Am I meant to create a Text file and new sub-folders in the iCloud Shortcuts folder?

I'm very confused.

EDIT: Okay, nevermind. I was trying to make this work on MacOS first and it seems like Shortcuts can't access Background Sounds yet.
 
Last edited:

arw

macrumors 65816
Aug 31, 2010
1,092
857
Feel free to reply if it does not work on your iPhone/iPad.

Shortcuts can DO quite a lot by default but often lacks reading if a setting/function is active or not.
In this case, Shortcuts can turn Background Sounds on or off but has now way of checking the current status which makes a toggle function impossible.
So my Shortcut creates a (local) .txt file and after de-/activating Background Sounds, it writes the corresponding status (On or Off) into said file.
When running the Shortcut, it first checks if said .txt file exists and if it contains "On" or "Off" to execute the exact contrary.

It stores the .txt file locally per device. "On My iPad" is the local root of the Files.app.
I like the "/Shortcuts/buffer/" subfolder hierarchy but it’s customizable of course. Just don't put it in an iCloud folder if you plan on using the Shortcut on multiple devices.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.