Help creating Apple Shortcut with Soro for Sonos

By mr grieves, 12 September, 2024

Forum
iOS and iPadOS

I'm trying to write an Apple Shortcut that will save what's currently playing in a room on my Sonos system to a text file. (So if I listen to the radio or something I know where I was and go back to the same track later)

I've nearly got it to work, I think, but am just failing on something stupid that I can't figure out.

I have three actions:

1. Now Playing (from Soro). I've selected the room here.
2. Set variable playing to the result of the previous action.
3. Save file. I selected a text file, told it to overwrite it and am using the playing variable.

If I set the Now Playing action to show me what it outputs, it gives me the name of the artist and the track, what are likely a couple of emojis then the group name. I only need the artist/track name but that will do fine.

However, when I run the shortcut and open up the text file in iCloud, it only contains the group name.

If I go to the variable assignment, it seems to think the type of the Now Playing action is Sonos Group. So I suspect the problem is that the variable is just getting that bit for some reason. I tried changing the type to Text and messing with a few other things but couldn't find anything that helped.

I have tried ChatGPT but it's just making stuff up as far as I can tell.

Anyone got any ideas what I might be doing wrong?

Options

Comments

By mr grieves on Saturday, September 14, 2024 - 21:22

Well I found out that my set variable action was a bit redundant as I can just refer to Now Playing directly from Save file.

But still can't get it to write more than the group name.

By Brian on Saturday, September 14, 2024 - 21:22

Hey Mr Grieves,

Have you tried going into your Shortcuts app on iOS, and looking at the Shazam shortcut? While I do not know much about the Sonos or Soro applications, the Shazam shortcut may give you some ideas for the shortcut you are working on.
Just a thought…

By Ollie on Saturday, September 14, 2024 - 21:22

I'd also suggest looking at the reddit for IOS shortcuts and asking on there. A much wider community of people who use shortcuts and a lot more experience. My forays into shortcuts, at best, has been simple. Soro is excellent though, I especially like the ability to share what's playing from apple music through share sheet to play on a sonos device. So much nicer to browse in apple music than the rather cruddy sonos app, which has never been much fun for us, even before the chaos.

Recently got a pair of era 100s, and, man they are a joy to listen to, though only when playing through sonos itself. airplay sounds rather gutless by comparison, think it is the difference between 16 and 24 bit dynamics rather than sample rate.

By mr grieves on Saturday, September 21, 2024 - 21:22

I could have sworn I'd replied to this already... anyway...

Thanks for the replies. The Shazam shortcut only has one action so isn't really helpful in this case, but it was worth a try.

I've spent a bit more time with it, and from what I can gather every action has something it outputs. In Apple Speak this is a Magic variable. This variable can be in any number of data types. In this case, it's a Sonos Group or something. When you use the variable, you can decide which of the properties of that type to use. So for images I think there's filename, width, height, that kind of thing. But in this case, it only has the Name of the group.

You can tell Shortcuts to use a different data type, and in this case it must do some sort of casting between them. For example, if you have the Uri data type, and change its type to Article it is clever enough to go and download the uri and get its content. But I can't find anything that is useful in this case.

When you select to show the output of an action, I think it is triggering something entirely different - a preview of some sort. So I guess the developer can do whatever they want with it and it has no particular bearing on what other actions can use.

So my belief is that the Now Playing action for Soro is pretty useless unless you literally want Siri to speak it to you. I don't believe I can use it for anything else.

I contacted the dev via the app after I created this post, but he didn't get back to me sadly. He has since released a major new version but it doesn't help me much. It does change the app to a now playing screen.

Thanks for the tip re reddit - I've only ever encountered reddit via a google search and I've always found it pretty horrible to navigate so I'm usually out of there pretty quickly. How do you access it? Are you using an app or going straight to the web?

By mr grieves on Saturday, September 21, 2024 - 21:22

Thanks, Ollie - I have posted on reddit so will see if I get a reply.

In the meantime I set up a shortcut to speak the contents of the text file. I've got to say, I am amazed by how bad Apple has made the shortcuts interface. It is horrible. I don't know if it's just because of VoiceOver but it seems so over-complicated. It doesn't help that the options to add new actions is always there, as is the toolbar. It would be so much easier if you just double tapped an action, then went to a separate page where you could edit it in isolation.

I've also been finding that if I make a mistake then it's really hard to fix. I was trying to add Get File from Folder action and somehow had it set to getting the path from the shortcut input. And I couldn't find any way to change it afterwards, nor any way to get rid of the massive input panel that appeared at the top. I ended up deleting the shortcut and starting again.

I wanted to just select the file I wanted, but instead you can only select the folder, and then have to go through a really weird interface. There are various options to get the content from clipboard, or a variable or whatever and then after that there's a keyboard. There's seemingly no text box associated with it, just a software keyboard even though I was using a bluetooth keyboard. I couldn't seem to paste the filename in, so had to type it. But you don't get any feedback and seemingly can't delete characters when you've entered it.

I'm actually quite liking shortcuts but I wish they weren't so annoying to setup.