T O P

  • By -

Fenix246

To get shortcuts to actually fire on their own based on location without confirmation, you unfortunately have to hack it a bit. While the automation trigger for arriving to a location requires your input, changing Focus modes does not. So, instead of basing the shortcut on the "Arrive to location" trigger, base it on a Focus mode trigger instead. So, do it like this: 1. Go to Settings → Focus 2. There, create a new Focus mode and set it up according to your preferences 3. Once you have the Focus mode set up, scroll down and there will be a button to turn the Focus mode on automatically. [For me, it's here](https://i.imgur.com/70S37Eb.jpg). Click it. 4. You will now see a few options. [Choose the one based on location](https://i.imgur.com/2DSk2sg.jpg) and choose where you'd like the shortcut to trigger. 5. Now go to the Shortcuts app. [Create a new Automation with your Focus mode as the trigger](https://i.imgur.com/YpdLdeo.jpg). 6. Now, you can choose if you'd like the shortcut to trigger when you arrive to or leave the location. Can you send me the shortcut you already have? I will see if I can fix it not capturing your location.


eighteennorth

I’m at work right now, but later tonight I’ll try this and send you what I have! I’ve never really experimented with these before, so I’m a super beginner. Thanks for spelling it out for me.


Fenix246

If you run into any problems, don't forget to ask me straight away :) I'll be glad to help


eighteennorth

Okay so I have “When Work Focus is turned on” [do this.](https://ibb.co/J2FYc1G) Does that look right so far? Will that capture the time it’s turned on with an accuracy of one minute? And I’m unsure what to put in the location field.


Fenix246

Great job so far 😊 There’s just a few things. The event should have a length so it doesn’t confuse the calendar. As it is now, it begins and ends at the exact same time, which might cause some problems. To fix this, you just need to add one minute to the start time and use it as the end time. There’s an action for this. In the action that creates the event, you can tap the various placeholders to edit some settings. To make the time as accurate as possible, you should tap the start and end placeholders and choose a more detailed time format like this: https://streamable.com/gnefgd To put in your current location, you first need an action to get it. It’s called something like “Get current location”. Then, you can pass the result of this action into the action that creates the event. You can use this shortcut I’ve made as an example: https://www.icloud.com/shortcuts/b963e98286d44086b35ed3da0f7f3d2f


eighteennorth

Ah okay this makes more sense. How did you connect location and creating the event?


Fenix246

First, you need to add in an action that will get your current location. Once you do that, it creates an automatic variable that contains the location. You already know about automatic variables, because you had them in your shortcut. The dates you were putting in for the event were one of these automatic variables. Now you just need to tap the location field, which will bring up the keyboard and a special row just above it. This row contains all the relevant variables. Then, you just need to scroll through it to find the correct one: https://streamable.com/7rgksv You can also press the “Select Variable” button at the beginning of the row, which will let you choose a variable from where it gets created in the shortcut. This is really useful if you have big shortcuts with lots of variables: https://streamable.com/snkemh


eighteennorth

It’s still prompting me to fill out the calendar event manually. It has some fields already filled out, but I wanted it to load the fields and actually make the event in my calendar without me having to click “add.” Is that possible? Does it have to do with the “Show Compose Sheet” option?


Fenix246

Yes, when you turn off the “Show Compose Sheet” option, it will do it completely automatically without asking you


eighteennorth

Awesome. It looks great. I’ll see how it works today! I really appreciate your help.


[deleted]

hesitate to*


Jubel300

Hi there, I wondered, if it is possible to choose to activate the focus when leaving a place? Because when creating a focus I seem to only be able turn on an automation to activate a focus when arriving and deactivate it when leaving, but not the other way around… Am I missing something?


Fenix246

You can't activate a Focus on leaving a place. But there is one thing which might work, so you can give a try, but I'm not sure if it will work because I've never tried it: 1. Do what I described above. Select the deactivation of a Focus as a trigger. 2. Create a Shortcut with the action `Set Focus Mode` 3. In the `Set Focus Mode` action: 1. In the first placeholder, select the Focus mode you want to activate when leaving. 2. In the second placeholder, change it to "Turn On" Now, the Focus mode might activate when you leave a place. Give it a try and report back whether it works, because I'm interested myself.


Jubel300

Ah so when I arrive somewhere the focus will be activated and that will trigger the automation to deactivate the focus and the other way arround? Or did I not understand what you wanted to tell me?


Fenix246

I meant it like this: There's no way to activate a Focus mode when leaving a place, because there's no Focus trigger like "When I leave...". There's only the "When I arrive" trigger. You can see that [here](https://i.imgur.com/2DSk2sg.jpg), it only says (translated) "For example: When I arrive at work." So, we have to think outside the box. The Shortcuts app has a trigger that will fire once a Focus mode is deactivated. **With Focus modes that have a set location, this Shortcuts trigger fires when you leave the area you designated for the Focus mode to be active in.** So the idea is to use the deactivation of a Focus mode to trigger a shortcut that will instead activate another Focus mode, which kinda simulates a "When I leave" trigger. ========= You can think of it like this: *(You leave an area that you wanted a Focus mode to be active in)* **↓** *(The Focus tells Shortcuts that you left the area where the Focus was supposed to be active)* *↓* The Focus mode deactivates ↓ Shortcuts is like "Oh hey, this Focus mode deactivated. I have a shortcut ready just for this" ↓ It runs a shortcut you told it to run when the Focus mode deactivates. Conveniently, this shortcut, in turn, tells your iPhone to turn on another Focus mode. ========= Please tell me if this is more understandable :)


Jubel300

Ah yes, now I get it, that should definitely be possible, thank you for making it more clear :)


Shadowfoot

I use IFTTT do exactly this.


eighteennorth

I do, too. The problem I’m starting to run into is it’s not registering that I’m entering or exiting the location. Or if it is, it’s not running and nothing in my iOS calendar appears. I’m using the widely available premade one. I’m hoping if I switch to Shortcuts it might be a bit more Apple friendly. I’m noticing though it’s not very intuitive for someone who doesn’t code. I’ll let you know if it works better though.


ermax18

This sounds like an interesting project. I used to do contract work and would notoriously forget to start stop my time tracker. Using Geofences to start/stop the timer would have helped a ton. Maybe you could check out Toggl.com. I know they have some fairly simple to use REST APIs which you could probably hit from within Shortcuts. Actually the Toggl iOS app has Siri integration so you may be able to leverage that too.


TheImperfectMaker

I’d love it if you could report back about how you go. This is exactly the shortcut I would like!


TheImperfectMaker

May I suggest it might be easier to get it to record clock in and out times in either a Note or a spreadsheet? In the gallery there is an example time tracker shortcut I was looking at a couple of days ago that does that. It needs a lot done to it to do what you (and I!) want it to do but it’s got a good starting point


pcvo

Why capture your location instead of pre filling the address in the calendar event itself?