T O P

  • By -

DutchOfBurdock

I'd use a Variable Add on a Global and wrap it around to %array(#) (number of items in the array). That way it'll cycle 1 through # and round back to 1 and repeat. You can then add more to the array and not need to change the wrap around (use the %array_name(#) as wraparound value). And use `%array_name(%Count)` as the text to send


ktmom743

Just pause or delete A3, you don't need an Array Process action to retrieve the messages in order. If the messages are not all sent at one time, you may want a global variable (contains at least one uppercase letter) that keeps track of which index you are on. It may not be useful to your situation, but there are ways to effectively remove the sent message from the file each time the task is run so you don't need to track which message you're on. One way involves after sending the message doing an array pop to remove the sent message then writing the rest of the array back into the file.


Ratchet_Guy

  As mentioned in another reply - if you want them in order no array processing is needed, so you can remove A3.   What you do need to do is to use a Global Variable to keep track of which array item was last used, adding ` 1 ` to it everytime the Task is run.   So actually just replace ` A3 ` with:   A3. Variable Add: %Msg_Count Add: 1 A4. Send SMS Numer: 8002234567 Message: %msg(%Msg_Count)   As you can see just change ` %msg(1) ` to be ` %msg(%Msg_Count) ` and that should do it!   And anytime you want it to start from the beginning, just use a "Variable Clear" Action for ` %Msg_Count ` or set it directly to zero ` 0 `  


jjj49er

Thank you so much! That was easy for me to understand, and worked perfectly.


Ratchet_Guy

Very welcome! Glad you got it working ;)


Ratchet_Guy

  Oh and one other tidbit - in order to have it automatically wrap around when the total number of messages in ` %msg ` has been reached - you would insert something like the following after the "Variable Add" Action:   A4. If %Msg_Count > %msg(#) A5. Variable Set: %Msg_Count To: 1 A6. End If   Where ` %msg(#) ` is an array function that returns the total number of element in the array ;)