58: Automating with TJ Luoma

Hi folks, trying to make a Shortcuts Automation equivelant of the weekend App block on iOS here. When “Email” launch -> Check if it’s Sat / Sun -> If yes then give it an alert “Hey you shall rest” and launch “Netflix”.

I got the most part working, two remaining problems though:

  1. The below shortcuts is used to check if today’s Sat (value=7) or Sun (value=0); For now I check it first whether it’s Sat and then using another If to check whether it’s Sun. How can I complete the task within one If condition? I tried writing it like “If Formatted Date is 0 or 7”, it doesn’t work.

  2. I wish to have an “exit route” to use Email on weekends in case the flat is on fire. At the moment, whichever way I launch Email at weekends, the Automation will lead me to Netflix unless the Automation is de-activated. How can I jump out of this closed loop? Thanks!

For English, check the first letter of the day’s name.

There is no loop as such, you just need to insert a user driven condition.

This shortcut should illustrate a way to do both.

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

If you find the menu choice too tempting then your in case of emergency hurdle is simply to remove the automation associated with opening the email app.

Hope that helps.

This weekend trick works. Thanks!

I’ve tried the choose from menu method, now got stuck in another infinite loop:

Automation triggered when Mail App launched → Menu appears for choices → Choosing the Mail option nonetheless → Switched to Mail, however triggering the Automation all over again → Menu appears for choices

If your menu choice is choosing not to open another app, does it not continue into Mail without trying to open it a second time?

Another alternative (to manually disabling in Shortcuts) if you wanted to have a less disruptive approach, you could check for the existence of a file - e.g. if you have to work one Saturday you write a file with that date into the Shortcuts file area; or you could have a special entry in your calendar for the day. You could create a second shortcut to set those up, and in each case they would just be temporary overrides meaning you wouldn’t need to remember to re-enable as you would for the manual enable/disable via the Shortcuts app.

Hi TJ. I’m really excited to try this but my newbie-ness is getting in the way. How do I install the script into Bitbar plug ins? I promise I’ve googled and searched before asking here.
Thanks again for the great work
Danny

1 Like

Hey Danny

Don’t worry, we were all new at one time.

To add a new script to BitBar, you’d put a script into the folder that you’ve designated for BitBar’s plugins. The menu bar icon even has an option to open the folder right from the menu bar.

Once the file is placed into that folder, it needs to be ‘executable’ (basically to tell the computer “this isn’t a file like a text document, it has commands in it.”)

So let’s assume your Plugins Folder is named “Bit Bar” and it inside your “Documents” folder.

The easiest way to make them executable is to go to the Terminal.app (in Finder, go to “Applications” and then “Utilities” folder).

Launch Terminal.app

Type:

cd "$HOME/Documents/Bit Bar/"

(If your plugins folder is named something else, replace the appropriate names above.)

Once you have done that, you can see a list of the files (to make sure you are in the right folder) by typing ls -l (note that those are lowercase Ls where ls stands for list and -l stands for “long”)

If you have a file called “MyScript.sh” in that folder and want to use it in BitBar, you need to make it executable, so you would type:

chmod 755 MyScript.sh

Then, using BitBar’s menu item, you would want to choose “Refresh All” to get it to show up in the menu bar.

So…

Now, having said all of that… what script are you trying to get into BitBar?

4 Likes

Thank you thank you! It’s the battery one.
I’ll get started on your stream deck ones right after that!
You can share with your congregation that you have fans in Israel too!
:pray::pray:

Great! Let me know if you have any problems getting it to work. Getting started with something new is already tricky.

2 Likes

When the Automation is triggered, I am already brought from the Mail screen to the Automation / Shortcuts App screen. The menu and selection also happens on the Automation / Shortcut App screen. If I chose none action for one of the menu, then it finishes and stays in the Automation / Shortcuts App; If I chose menue action going to Mail, then it triggers a new Automation

Are you on iOS14 yet? Did you try any of the non-menu options I suggested?

I love the upcoming calendar button! Question (because I can’t figure it out) - it keeps dinging over and over and it’s driving me crazy. How can I turn this off without disabling the macro or paying ransomware? :slight_smile:

Do you mean by Stream Deck calendar item?

yes, the calendar item for Stream Deck. Seems to ding a lot and I’d like to turn it off if possible! :slight_smile:

I love this though!

OK, so it’s not supposed to make any noise at all, as far as I remember.

Is the “ding” that you are hearing the same as your “System Beep”?

If you aren’t sure, go to System Preferences » Sound » and click on the “Sound Effects” ‘tab’.

It should show you the selected sound, but if you click on it, it should play it for you so you can hear it.

Thanks for clarifying! I didn’t think I had any alerts turned on, but I did see the volume was up, so I’ve turned it down. I’ll see what happens today.

Thank you for responding to this message and for sharing everything on the podcast. It really has been wonderful and so helpful!

I can’t get the battery script to show up in BitBar. I followed the directions above, and then entered

chmod 755 batteries.5m.sh

and then selected “refresh all” from the BitBar menu. I have tried changing plugin directories, but that didn’t work.

Are you happy a month in?

Very much. I’ll probably post about my setup eventually.

1 Like

Wasn’t able to update to iOS14 until recently. You’re right, it’s no longer an issue in iOS14. Thank you!

1 Like