Accepts
Contacts and Phone Numbers
COMMENT
Setting default Country code:
Replace with country code of your choice without the + sign
Ex: 91 for India (country code +91)
TEXT
91

Text
VARIABLES
Set variable
Country code
to
Text
CONTACTS
Get phone numbers from
Shortcut Input

Phone Numbers
VARIABLES
Set variable
Shared_contact_phone
to
Phone Numbers
SCRIPTING
If
Shared_contact_phone
does not have any value
SHARING
Get clipboard

Clipboard
COMMENT
Removing "empty spaces" from the phone number in front and back and in middle
DOCUMENTS
Replace
^\s+
with
World
in
Clipboard

Updated Text
DOCUMENTS
Replace
\s+$
with
World
in
Updated Text

Updated Text
DOCUMENTS
Replace
with
World
in
Updated Text

Updated Text
CONTACTS
Get phone numbers from
Updated Text

Phone Numbers
VARIABLES
Set variable
Shared_contact_phone
to
Phone Numbers
SCRIPTING
End If

If Result
VARIABLES
Set variable
Clip_phone
to
Shared_contact_phone
COMMENT
The next set of actions check to see if the clipboard does have a phone number or give the user a choice to pick
SCRIPTING
Count
Items
in
Clip_phone

Count
SCRIPTING
If
Count
is greater than
COMMENT
Confirmed input has phone
1. Checking to see if it has a 0 in front and if so to remove it. Happens when phone number from default country
2. Checking to see if country code is included or default code needs to be added
TEXT
Split
Clip_phone
by
Every Character

Split Text
SCRIPTING
Get
First Item
from
Split Text

Item from List
SCRIPTING
Count
Items
in
Split Text

Count
SCRIPTING
If
Item from List
is
0
SCRIPTING
Get
Items in Range
2
to
Count
from
Split Text

Item from List
VARIABLES
Set variable
Clip_phone
to
Item from List
SCRIPTING
End If

If Result
SCRIPTING
If
Clip_phone
contains
+
COMMENT
Remove the +
DOCUMENTS
Replace
+
with
World
in
Clip_phone

Updated Text
VARIABLES
Set variable
Full_phone
to
Updated Text
SCRIPTING
Otherwise
LIST

List
TEXT
Combine
List
with
Custom
Text

Combined Text
VARIABLES
Set variable
Full_phone
to
Combined Text
SCRIPTING
End If

If Result
SCRIPTING
Choose from Menu

Menu Result
SCRIPTING
WhatsApp Full_phone

Menu Result
SCRIPTING
Edit Number (without +)

Menu Result
SCRIPTING
Ask
Edit phone
Default Answer
[{'class': 'magic', 'value': 'Full_phone', 'glyph': 'assets/cat/Variable.svg', 'UUID': ''}]

Provided Input
SCRIPTING
End Menu

Menu Result
SCRIPTING
Otherwise
COMMENT
Clipboard is blank. No number passed as share input
SCRIPTING
Ask
Input number with country code (without +) Ex: 916026063750

Provided Input
TEXT
Provided Input

Text
SCRIPTING
End If

If Result
SCRIPTING
Ask
What would you like to say?

Provided Input
VARIABLES
Set variable
Message
to
Provided Input
SCRIPTING
Ask
How many messages would you like to send?

Provided Input
SCRIPTING
Repeat
Provided Input

Repeat Results
MESSAGES
Send "
Message
" to
Recipients
SCRIPTING
End Repeat

Repeat Results