send sms to phone numbers from a txt list

valhala

New member
hi, i am trying to make the macro - queued sms auto - work. i have replaced the path with my path to sms .txt file and contacts and i followed the guide by entering comma in the file but it seems i have permission denied error. how do i make it work as i need to send a sms to a list of phone numbers. can you please help me?
 

valhala

New member
my path to contacts and sms .txt files are towards my internal storage instead of external sd card like in the original macro.
 

Jacob L

Moderator (Lawsonator)
If you provide us your macro and a sample contacts.txt it will help us help you
 

Dm114

Well-known member
hi, i am trying to make the macro - queued sms auto - work. i have replaced the path with my path to sms .txt file and contacts and i followed the guide by entering comma in the file but it seems i have permission denied error. how do i make it work as i need to send a sms to a list of phone numbers. can you please help me?
As I don't know whether it is possible to read a text file via a script shell on a non rooted device in MD, I would suggest, if it's possible for you, to store your phone numbers directly in a local or global string variable you could manually modify every time you need to.

Another detail I noticed: in your first 'Extract text' action you wrote the following Regex rule \d[0-9]+. As \d already stands for digits from 0 to 9, [0-9] is unnecessary and \d+ will give you the same result...
The 2 'Replace all' action that follow it could be gathered in 1 by adding the separator (comma in your example) to the [lv=ContNum] in order to replace the whole string by an empty one (i.e. to erase it from the original list). My suggestion would be not to replace the separator (that even could be a new line) to avoid problems if the last number of the list happens not to be followed by the seperator. Just test if the extracted number '[lv=ContNum]' is empty to exit the loop.
 

valhala

New member
Hi, i am not a programmer. I don't know how to apply your suggestions. If you would be so kind and tell me: go there and change that; i would be very grateful.
 

Dm114

Well-known member
Hi, i am not a programmer. I don't know how to apply your suggestions. If you would be so kind and tell me: go there and change that; i would be very grateful.
Haha... While seeing your screenshots it's hard to imagine you are not a programmer. Now I understand you probably used an existing macro in the store!

Ok, let me some more time and and I will write something for you...
 

valhala

New member
Haha... While seeing your screenshots it's hard to imagine you are not a programmer. Now I understand you probably used an existing macro in the store!

Ok, let me some more time and and I will write something for you...
:) Yes i did used an existing macro from the store.

Much appreciated. I am looking forward to your reply.

I am familiar to some degree with Macrodroid. I managed to create a macro on my own that starts the hotspot when my phone starts, but that does not compare with what you and other professionals are creating here. With all my limitations, i am able to see that MacroDroid is far much better than any other platform. Also, while browsing i noticed that the community here is awesome!
 

Dm114

Well-known member
Hi, i am not a programmer. I don't know how to apply your suggestions. If you would be so kind and tell me: go there and change that; i would be very grateful.
Here you have. Hope it will help you.
 

Attachments

  • Tst.macro
    6.6 KB · Views: 10
  • Tst.png
    Tst.png
    112.6 KB · Views: 29

valhala

New member
ok, i have imported this macro and i don't know where to add my path to the list ( for ex my path in my phone is /storage/emulated/0/Download/testmacro.txt) and the path with the actual text message is /storage/emulated/0/Download/sms.txt. where shall i add these paths in order to send the sms to the phone numbers located in the file testmacro.txt?
 

valhala

New member
photo_2021-08-06_20-15-57.jpg

Since i don't know where to add the path to my phone numbers list, i have this error. It tries to send a message to a random number.
 

Dm114

Well-known member
View attachment 780

Since i don't know where to add the path to my phone numbers list, i have this error. It tries to send a message to a random number.
As I told you, I don't think it's possible to read a text file and store its content in a variable with MD.

Unless someone knows a way to do that, you could open your text file with a dedicated app (even in your browser), copy its whole content in the clipboard and then paste it in the variable I named 'OriginalListOfNumbers'
 

420

Active member
As I told you, I don't think it's possible to read a text file and store its content in a variable with MD.

Unless someone knows a way to do that, you could open your text file with a dedicated app (even in your browser), copy its whole content in the clipboard and then paste it in the variable I named 'OriginalListOfNumbers'
i never tried it myself but according to Jacob this can be done with the shell script action.

 

Dm114

Well-known member
View attachment 780

Since i don't know where to add the path to my phone numbers list, i have this error. It tries to send a message to a random number.
So, thanks to @420 and @Jacob L you could replace the 1st action of the macro by the following action:
Applications > Script shell (with parameters in the screenshot attached)
 

Attachments

  • 20210806_142150.jpg
    20210806_142150.jpg
    275.6 KB · Views: 13

valhala

New member
Ok, so i replaced the action and now i have the following but nothing happens when i test the macro.
photo_2021-08-06_22-36-13.jpg
 

Attachments

  • Tst3.macro
    6.5 KB · Views: 3
Last edited:
Top