Hi! I have a shortcut that looks for birthdays in my contacts and sends a message if it finds any. I would like to check if the number is compatible with iMessage. If not, I would like to send a whatsapp message instead. Is there a way to check if a number will receive and imessage before sending the message?
I would also like to know if this is possible, as I would like to send a screenshot of my location to anyone that has iMessage else send a url to the maps app if they do not to negate charges!
Hey dude I was playing around and I worked out something that may help, you can get info from a contact and you can get notes, if you manually put in the notes âiMessageâ you can use âifâ to send your contact through your selected path. Iâm not trying to find a way to identify a contact through messages to change the contact info automatically, this is a short term fix though! If I work out how to iterate through each contacts messages and determine if the message bubble is blue or green, Iâll let you know hahah
Okay Iâve worked it out, and Iâve managed to work around what everyone online was saying was impossible. Itâs about %98 accurate for me also. But I think you will need to make sure your display is turned all the way up and try to stop it from dynamically changing as this is what Iâve been pulling my hair out over the last 6 days.
Okay so you will need:
Shortcuts,
Actions- free app that gives more shortcut automations,
Scriptable.
How it works, it starts in shortcuts and finds all of your contacts, puts them into a list and then iterates through them one by one; Scriptable is used because when you call the Messages app through shortcuts, it doesnât give the coloured name of chat bubble⌠so when you launch it through scriptable it does. So it runs through Scriptable and back to shortcuts, where it will take a screenshot of your screen; it will then crop out two specific areas of the screen.
The first area is the name; as itâs either blue or green.
The second area is where I was most likely to find a chat bubble, if it was an existing chat.
It then takes these two cropped images, merges them into one, and uses the âget dominant colour from imageâ tool from the actions add on.
The biggest problem I had was that although I was receiving hex codes in which I could identify blue and green, because iPhones use a dynamic display I could never match them.
So what I did was split all the hex codes into a list and I had a eureka moment. 98% of the hex codes that were green started with â#7â so the shortcut takes the list of hex colours, and then uses a regx to take the first two characters. Youâre then left with a list. If that list contains a â#7â it writes in the contacts notes âSMSâ if otherwise it marks it as âiMessageâ
Youâre contacts should now be sepeatable by a simple input of âGet details from contact - notes/text - iMessage/SMSâ round of applause for me.
Please note I have left a couple of show results in there, if you remove them it moves a lot quicker and you donât have to press a button twiceâŚ
So here you go.
Copy and paste this into scriptable, make sure you name the scriptable file âGetContactâ. And in the options, turn on get âshare sheet inputsâ. URLs & Text.
args.openInEditor = true;
let cl = console.log;
let qName = args.queryParameters.scriptName;
let pNo = args.queryParameters.text;
cl(qName+" "+pNo);
function getContact() {
let phoneNo = encodeURIComponent(pNo)
cl
cl(phoneNo)
Safari.open(`iMessage://${phoneNo}`);
console.log(url);
}
getContact()
You will also need to download the actions app:
And this is the shortcut:
https://www.icloud.com/shortcuts/80627f1752d245cbb16910955a095172
Remember, screen brightness all the way up and try to turn off anything that will make it dynamically change.
Let me know what you think.
L.
This is genius. Thanks a ton! I had lost hope on this one but this is great.
Thank you again!!
You need to specify your own sound to play. The original shortcut looks to have had a specific sound file the creator used. Just point it at another sound file you have that you think would work well, or delete that and the play sound step entirely if you do not want any audible confirmation.
You may also want to post your prior solution in case it is of use to someone else who encounters the same issue you did.
Can u call me in telegram plz @azazws1
Sorry. I donât use Telegram and the the forum is here to promote shared and open discussion, not private discussion - that way everyone can contribute and everyone can learn.
Youâre aware youâre sending contact information to 3rd party apps who might sell that information?
Do you mean âActionsâ? If so you can actually view the code from Github to confirm for yourself that it isnât sending any data back to the developer.
Legit geniusâŚand game changer. Thanks for making this public mate. I tested this on my end and it seems the âscreenshotâ feature is buggy because all our iPhones have different sizes and therefore, X and Y coordinates. How were you able to find the specific coordinates you needed when first setting this up?