Dual SIM - how to script switching which line gets used?

Within the phone app one can choose which line in a dual sim setup is used. Is it somehow possible to change that from a script?

I‘d like to implement an automation whenever I add a contact or maybe once a day newly added contacts get updated to set the phone line to be used. E.g. if a contact does come with a „corporate“ email address I add it to the specific group and set the business-line to be used.
If not, my private line should be used…

Any hints or tips?

Interesting thought. Wouldn’t know how to do that on an iPhone, but I do store sim preference for numbers in my address book so it uses work sim for work calls. You can set a preference for the outbound sim in the address book record. I don’t think this can be set on groups.

It is not possible on groups… that is why I’d like to write a script which regularly updates the contacts.