Termux - passing to Tasker

29 views
Skip to first unread message

Igor Czarnecki

unread,
Sep 12, 2021, 4:14:25 PMSep 12
to Tasker
Hello!
Ive got problem and im stucked.
im using shell scripts in termux to call actions in tasker.
im doing it like here:
so for example i can send sms like so:
#tasker#
system-> intent received action: net.dinglish.tasker.send
task:
send SMS: Number: %number; Message: %message
#termux# send.sh
#!/data/data/com.termux/files/usr/bin/sh
am broadcast --user 0 -a net.dinglish.tasker.send -e number "$1" -e message "$2" > /dev/null
so when i execute send.sh 1234567 foo it send "foo" to 1234567
as you can see i can pass variable $1 and $2 and everything is working well.

But from few days im trying to send whatsapp message like this:
#Tasker#
profile: whatsapp
Action: phone->contact Via App 
contact: MichaelX
app: .../vnd.com.whatsapp.profile
text: TEST_TEXT
#termux#
#!/data/data/com.termux/files/usr/bin/sh
(this way) am broadcast --user 0 -a net.dinglish.tasker.whatsapp > /dev/null
(or this way) am broadcast --user 0 -a net.dinglish.tasker.whatsapp -e number "$1" -e message "$2" > /dev/null
But when im executing it, whatsapp isnt opening and im geting the Text value inside termux and output "TEST_TEXT" (or %variable) command not found...
How can I do it? How can I call it? Or maybe do YOu know any other way to call it from termux...

Thank You so much, couse im out of ideas how can i pass it.

ktmom

unread,
Sep 12, 2021, 5:21:55 PMSep 12
to Tasker
I don't use WhatsApp so I can't directly answer.  I'm wondering though, if you remove Termux from the equation, can you send a WhatsApp message from your task in Tasker?  

The broadcast intent is an effective way to get data from Termux into Tasker for further processing.  I do this after running rsync in Termux then send a confirmation back to my Tasker task.  I'm not clear why Termux is in use in your senario.  You always need a "intent received" context in your profile to receive the broadcast from a Termux script.  I see you describe that in you SMS example but not in your WhatsApp example.  This is why posting the profile description is more effective than trying to describe your setup.  (Long press on named profile - no asterisk - to highlight it, 3-dot menu -> export -> description to clipboard -> 4 spaces then paste into a post)

Reply all
Reply to author
Forward
0 new messages