I have the following code which uses the user's clipboard to WhatsApp's online API.
on run {input, parameters}
set text1 to the clipboard
do shell script "open https://api.whatsapp.com/send?phone=" & text1
return input
end run
Now I want to check if the number matches the international code to use in WhatsApp's API correctly.
For example, if I copied a number 021 123456, I want to replace the first few digits with +994021 123456. What happened here is replace the first 0 with +994. However if the number already starts with +994 then there is no need to amend it.
How do I create a code to do this?