I created this code that should launch whatsapp with a specific number in clipboard:
on run {input, parameters}
set text1 to the clipboard
set text2 to 1 - text1 as real
do shell script "open https://api.whatsapp.com/send?phone=971" & 1 - text2
return input
end run
*
The subtractions are added to copy the correct number into the form
*
However, the phone number is stated in an exponential form which gives an error.
Example: 0501234567
Expected Output: 971501234567
Actual Output : 9715.01234567E+8
How do I fix this?
0501234567
onthe clipboard
and your goal is to open this URLhttps://api.whatsapp.com/send?phone=971501234567"
, then simply,do shell script "open https://api.whatsapp.com/send?phone=971" & text 2 thru -1 of (the clipboard as string)
should do it. Or am I missing something?