Automators 47: The Daily Brief

1 – In Rosemary’s Shortcut, update the dictionary to contain the list of known WiFi networks that you might connect to (network name as the key, full address as the value)

2 – add an Exit Shortcut command to the end of the Shortcut (Shortcuts will add the magic variable If Result automatically.

In the Shortcut that you want to use the location data, use a Run Shortcut action to call the Get Location Shortcut and then use the magic variable returned from the run command in whatever command you want, here I have passed it in to the Get Weather action. You do need to update the magic variable to be a Location as shown in the second image.

Hope this makes sense and answers your question…

4 Likes

This is exactly what I do!

2 Likes

Thank you so much @Tony - it was the last part I didn’t understand before your excellent explanation :pray:t2:

1 Like

@Elmanic Glad it helped.

1 Like

I got it to work now - but I do wonder why the exit shortcut action wasn’t included in @RosemaryOrchard shortcut?

Another question if WiFi is turned off I get this error (see screenshot).


Is that a mistake or should the shortcut behave differently?

All the best Martin

It depends upon how you want to use the snippet that Rosemary provided. As provided it allows another line to be added to the end of the Shortcut to use the location information directly; with the Exit Shortcut you then use the snippet as a reusable function to call from another Shortcut.

The error shown is due to no key being passed to the dictionary call when WiFi is turned off. I’ve modified the original Shortcut to allow for this case here:

You need to add the If block (highlighted in red) and then update the magic variable (highlighted in green).

My Shortcuts is playing up and will not generate a link to the correct Shortcut… Time for a reboot and I’ll try the link again later.

OK, this link should now work!

https://www.icloud.com/shortcuts/1a1e0d25d2854a9ca3b87c04c0b739f1

(Changed the wording to WiFi Off instead of Network Off

1 Like

Actually all shortcuts provide an output if run inside another shortcut, you just need to make sure your shortcut only has the output you need :wink:

2 Likes

True! I just tend to use the Exit Shortcut to make sure I return the intended data. :grin:

I added the if action and it works perfectly :pray:t2: thx again to you both @Tony and @RosemaryOrchard :grin:

1 Like

I got stuck on this part, how can I determine if a shortcut has already been run in today please?

Use a Data Jar variable to store the date that the Shortcut was run.

The first action checks to see if the variable exists. If not, assume that this is the first time the Shortcut has ever been run (ie not run today).

If the variable exists, compare the date (formatted to be date only, no time) with today’s date. If they match, the Shortcut has been run today. If the dates don’t match, it has not run today.

Update the Data Jar variable with today’s date.

Here is the Shortcut sample.

https://www.icloud.com/shortcuts/822dbd5ce6f24f84bf9dfda8b97c1a3c

Hope this makes sense.

1 Like

That’s super clear, thank you Tony!

1 Like

Glad that it has helped.

This was a super interesting episode that’s helped me improve my morning briefing.

Currently I have the commute time to work. What’s the easiest way to only do that on monday through friday?

Assuming your device is using English (or German, some other languages may work too), format the date as EEEEE, if it is an S then it’s the weekend, if not it’s a weekday. I have this as a subroutine shortcut, if it’s a weekday it checks a calendar to see if it’s a holiday and returns true or false for me.

https://www.icloud.com/shortcuts/a251ce36b64a493aa747f8687430f65a

2 Likes

Thanks.

I never use subroutines because I hate them cluttering up the shortcuts. I hope Apple adds better organization in iOS 14 :wink:

I use this in a lot of places so find subroutines much better than adjusting the logic in lots of shortcuts - and inevitably missing one or two!

3 Likes

For me the aspects of reuse, flexibility and compartmentalising of functionality far outweighs any organisational issues that might be apparent within the Shortcuts app. I still find that in Shortcuts itself, anything over fifty lends itself more efficiently to searching.

However, I would note that a good naming standards/hygiene is incredibly useful in regards to searching and organising, and if you are having organisational issues or feel you could, then you should absolutely be considering LaunchCuts (episode 45).

If you happen to have naming standards and LaunchCuts, you can even use Smart Folders to great effect in automatically organising many of your shortcuts.

1 Like

Just listening to this episode today, Rosemary your location shortcut is awesome! I have been using the workaround of requesting current location from the “Get current weather at…” action, which for some reason runs a lot quicker than the “Get current location” one. Your approach is still faster for when I’m on a matching wifi network, so I made this shortcut to combine the two for maximum speed and efficiency:

https://www.icloud.com/shortcuts/b8fe06117b97426ca8009b583698be5d

1 Like

An AppleScript for changing Highlight Color and Accent Color in MacOS that can be used in Keyboard Maestro:
tell application “System Events”
tell appearance preferences
set properties to {highlight color:purple}
end tell
end tell
tell application “System Events”
click checkbox “purple” of window “General” of application process “System Preferences”
end tell

I have barely ever done AppleScript before, so maybe this could be better. You have to open the General Preferences pane first (Keyboard Maestro will do it) for it to work on the Accent Colors. The Accent Colors of pink and yellow, however, won’t work this way. I had Keyboard Maestro run the AppleScript.

The Keyboard Maestro action “Set Desktop Image” (Category is “System Control”) works to set the wallpaper.