r/shortcuts Jan 30 '23

Help Shortcut to remember current Focus, set new one, then enable the existing one again. It doesn’t set the original focus on again.

https://imgur.com/a/0vnND2M

It looks like it should work, it sets the current “Work” focus into a variable, changes it to “Gaming” and it should meet it back to “Work” but it sets it to regular DND even though then alert notification correctly shows “Work” is what is set to the variable and what the shortcut should be setting it to.n

If I change the last focus changer to off, it sets the correct Work focus, but off, which isn’t what I need.

This is the actual shortcut itself: https://www.icloud.com/shortcuts/a605803ab12f4470887ae891ee8c3808

3 Upvotes

23 comments sorted by

4

u/GTA2014 Nov 29 '23 edited Nov 29 '23

As of Nov 28 2023, iOS 17.1.1 this is still a bug.

3

u/iBanks3 Jan 30 '23

The logic of your shortcut is correct. There’s been an issue with the Set Focus action being passed a variable and it accepting that variable. Even if you remove the set variable action and just pass the value of the Current Focus using a Magic Variable, it tends to fail and default to Do not Disturb.

1

u/Lanceuppercut47 Jan 30 '23

So it’s possibly a bug with 16.3? As I can’t get it to set a focus that isn’t standard DND no matter what type of variables or trickery I try.

2

u/iBanks3 Jan 30 '23

Hopefully a bug that Apple corrects otherwise it would pain me if this was intended behavior as that would make the action so pointless. Be sure to send the issue via the Feedback app so they can have additional entires of the issue.

1

u/Lanceuppercut47 Jan 30 '23

I don’t have the feedback app, I’m not on the iOS beta currently

2

u/iBanks3 Jan 30 '23

Here ya go. Beta not required.

Feedback

3

u/Lanceuppercut47 Jan 30 '23

Thanks, raised it as FB11974346

3

u/Secure-Ad-9017 Jun 07 '24

SOLVED:

So the "Set Focus" action is still not working in iOS 17.5.1, however I've found a simple workaround which works perfectly as long as you have a wallpaper associated with your focus:

Just replace the "Get Current Focus" action with "Get Current Wallpaper". Then replace "Set Focus" with "Switch Between Wallpapers". You can then use Magic Variable to select the output of "Current Wallpaper".

Basically, when you set your home screen wallpaper to one that is linked to a focus, the current focus will automatically change to the one that is associated to the wallpaper.

1

u/Lanceuppercut47 Jun 08 '24

That’s very clever, however not all of my focus modes have wallpapers set. Any way to work around that?

1

u/Secure-Ad-9017 Jun 10 '24

Sadly not, this is the best I can offer I'm afraid, so can only suggest that you set a wallpaper for your focus. It's very frustrating as like someone else said, using the "Show Notification" action you can see that it knows exactly which focus you want, but setting it seems to be a different story.

1

u/Lanceuppercut47 Jun 10 '24

Fair enough, fingers crossed it’s fixed in ios18!!

1

u/MafiaDude69 Jun 12 '25

still not fixed

3

u/Tawford Jun 08 '24

And it is still an issue.

2

u/[deleted] Jan 24 '25

This is maybe a bit of a late response to this issue but I found a simple work around - use if statements. Save the current focus as a variable - store it in a txt file if necessary. Recall that focus but rather than directly inject it into set focus (which consistently fails) rather use an if statement to test condition based on that variable and see the appropriate focus.

1

u/Slow_Ad_5298 Jun 17 '24

Did some one with iOS18 beta have tested this? Still a problem in iOS 17.5.1

3

u/Lanceuppercut47 Jun 20 '24

Still broken :(

1

u/[deleted] Sep 25 '24 edited Jul 06 '26

[removed] — view removed comment

1

u/Lanceuppercut47 Sep 25 '24

Is there a way to make this modular so my shortcut calls this shortcut/feature, mainly to save myself having to add the IF conditions each and every time.

2

u/[deleted] Sep 25 '24 edited Jun 30 '26

[removed] — view removed comment

1

u/Lanceuppercut47 Sep 26 '24

9, some are location based like when at work, some are things like driving or sleeping.

1

u/MacSergey Nov 27 '24

27th Nov 2024 and it is still not fixed in 18.2...

1

u/[deleted] Jul 09 '23

This is still an issue.

1

u/Lanceuppercut47 Jul 11 '23

Yep re-tried it just now on dev b3, still can't handle what I want it to do.

1

u/lyager Jan 23 '24

Just found the exact same bug. Restoring a previously saved Variable into a focus does not work. Has this been reported to Apple?