General Question about UI in Automation on iOS and Mac

Good morning!

I am trying to pick up some javascript to help automate some repetitive tasks. The first is trying to automate an email distribution list. I have 4 “roles” of people in my group, and 6 “regions”. In Shortcuts, I used Choose from List with the ability to pick more than one. However, I found that parsing the data was more challenging due to some (possibly just perceived) gaps in Shortcuts functionality (i.e. the ability to … break; … out of a loop).

So - requirements:

  • I need to be able to use the automation on both iPadOS and MacOS (as David says, I’m “Team Both.”)
  • I travel extensively for work, so I would like to save the JSON on an iCloud Drive folder and be able to call it when no networks are available.
  • I need to be able to designate 1-4 roles and 1-6 regions to receive the email.

I have written most of the script in Scriptable, but just realized that creating the UI may be a bit more of a challenge. Also, I’m unclear whether work done in Scriptable will translate well to a Mac environment (potentially node.js?)

Questions for folks further along this automation journey:

  • What do you use for UIs when you want the automation to be portable from iPadOS to MacOS?
  • What do you use to “tie” everything together?
1 Like

Can you describe a bit more about your distribution list requirements? I would imagine that a web service like Mail Chimp using a set of lists might give the quickest solution if you just need a basic list.

If you are looking to tie this in to something more, then the solutions are probably going to be something fairly different on each platform unless you find something with a strong common language set like say Python/Pythonista.

I’m not sure if the sorts of automation for JavaScript you would get on iOS vs. macOS for e-mailing would be particularly applicable to both platforms, but ReScript on iOS might give you the basis to use node.js there if that is the sort of approach you are looking for.

Since Shortcuts does not exist at the moment on macOS, that sounds to have been a bit of a non-starter anyway, but if a purely i*OS solution is viable, perhaps it would also be worth sharing what you had and what you got stuck with originally.

I keep a list of people, and their associated regions, as well as their role in the company (I started this last year on AirTable.). Then I wrote a shortcut which queries AirTable and returns (usually around 300) email addresses based on where and to whom I would like to send the message. Then it uses an x-callback to send the information to Airmail 3. At that point, if I’m currently at my desk on my Mac, I close the email to the drafts folder on iOS and wait for it to appear on the Mac. I add my text and send away (With a 2 minute delay of course. I don’t want to send “angry emails.”)

About the time of iOS 14, it appears that 2 individuals have been left off my emails. They have more than one region. So, now I’m trying to compare 2 arrays, which has seemed clunky (I’m happy to accept solutions that help fix this. They are important people that need to get these emails.). I’m currently trying to get it to iterate over the first array, and look for each member in the second array (which was my choose from list - regions). However, in Shortcuts I can’t seem to keep it from matching 4 times (individual is in 4 regions.)

I’m not doing client contacts. These are all my employees. My company expects us to use Windows and Microsoft. So I’m already rebelling by using iOS and and Mac.

Unfortunately, my company also does not provide me with an updated list. They provide me with an Excel sheet, that contains thousands more employees than I need. (So eventually I’ll need to write an automation to extract from that awful thing.)

Caught in the middle, and I like to learn new stuff. So I thought perhaps I could learn enough javascript that I could use TextExpander or Drafts to accomplish some of this. I’m getting there with understanding some of the very basics of Javascript. I’ve never looked at Python. I do use Hazel, which also seems Javascript friendly. I’m also a Keyboard Maestro owner.

But now I’ve got so many possibilities and options, I was asking more from a “how to best use my time and energy” to develop my knowledge and skill in an automation scripting language.

So, Keyboard Maestro, Drafts, TextExpander, Hazel, Scriptable, Shortcuts, Javascript, Python… Just don’t know where to head after some level of success with Shortcuts. But I would like to focus on something that would be more useful for both iOS and MacOS.

Frankly, I find some aspects of javascript easier than Shortcuts as well.

Thanks for any ideas/guidance.

  1. Shortcuts uses lists. If you sort/order your lists you can step through and find differences.
  2. Normally membership lists like this would be managed through group membership/properties applied from Active Directory available within Exchange and from there Outlook (which is a pretty reasonable Apple citizen set of apps). If you have enough employees in your org structure responsibilities to warrant automating a list I would be very surprised if your IT/HR group would not be willing to provide such groups to all staff as it tends to be the sort of thing they would make use of.
  3. Have you cleared the storage of company and employee information on Airtable with your company data protection officer? if not, you may be putting your company at risk by storing this information on an undisclosed platform. Typically IT should have access to interrogate and remove data from data stores like this as well as have the opportunity to validate the security, document any processes it is linked to, etc.
1 Like

Thanks for the reply. And yes, mine is a unique case.

1- Thanks for this. I am learning that sometimes instead of looking for a match, its better to look for a difference. I will look at my shortcut through that lens and see if I can come up with a different solution.

2 - Yes, but the way I need to slice and dice the lists is different from IT. So, one list has too many people included, and another is too few. Goldilocks problem. Unfortunately, there is a key gap that IT has no use for, and therefore to balance their resources, they don’t maintain that list. I can do a personal list, but it involves manually updating the list every time there is a change. And the worst thing is the Excel list they send me to ensure I update that list. BTW - IT is not in my purview, so I ask nicely and hopefully they help. I actually do use Outlook on the Mac, and while it is a pretty good app, I haven’t seen any integration with outside automation.

3 - I really only store email addresses, and basic facility information (phone numbers, etc.) in AirTable. I would like eventually to write an automation to convert a filtered version of the Excel Sheet into JSON, which I can them store on my machines. I have completed training on what can/can’t be stored where.

Thanks for the responses. And to be clear, I have a growing list of automation opportunities, and I’m willing to tinker in the evenings to learn this stuff slowly.

Future automation opportunities: Auto file documents in my archive based on facility/category (Hazel +/- JS & RegEx), Compare Excel sheet to JSON to auto-update the list, CRUD to update my JSON list from phone quickly while on-site if there is a change in staffing, Forward email or other information from another source to my regional lists, local database to store Site Inspection Data regarding ongoing facility issues (Notes, JSON, or other?) etc.

To distill my original question. “Tying things together” and filling gaps in functionality seems to involved scripting. Where is the best place to invest time? Javascript, Python, or is there some other cross platform option that looks promising?

Thanks again.

As long as you have pre-cleared it with your DPO, it should be fine. Otherwise if there is anything to tie the information to an individual employee (contact and location is typically enough) then you should not host the info on non-corporate systems without first getting permission to do so.

I don’t think there’s exactly a one size fits all platform or solution. Most of what you described so far in terms of tooling and process is tied to a single platform. The issue tends to be that languages and tools have to bridge to the OS to do certain things that are at an OS level, and the tools are not always available on most platforms. Languages might be available cross platform, but the tools that use them and the flavours of implementation can vary.

Usually people adopt one of two approaches.

  1. Use whatever tools best suit the job.
  2. Apply whatever tool you know to get the job done.

It sounds like you are naturally tending towards approach 2.

Based on that, I would say that JavaScript is probably the most widely used cross-platform language (e.g. JXA, Scriptable, Drafts, Omni products) and some tools are cross platform, but not suitable for all automations. However, JavaScript at this point in time probably gives you the widest base with the least amount of effort, but there are still platform and tooling differences to take into account beyond the base language to really be able to make use of it.

Hope that helps.

Thanks so much. And I’ll probably just go all in on JSON and store the information locally. Hence the posts on the Scriptable thread.

I do appreciate all the advice. I was staring at the “deep end of the pool” with starting to write UI elements, etc. in Scriptable. Which I guess in itself is getting outside the automation realm.