Sry, muss mal auf deutsch antworten mein Englisch gibt gerade auf
Also ich will den flow als eine Art Anrufbeantworter benutzen, er soll die SMS nach einander Vorlesen wenn ich im Auto Musik per Bluetooth höre.
Nur trotz meiner programmier Kenntnisse ist es halt daran gescheitert, das ich die Nr vom Listen Eintrag nicht gesetzt bekommen habe. Aber mit deinem Anstoß, sollte ich jetzt hinbekommen, probiers später mal aus kann gerade nicht Dann antworte ich auch wieder auf Englisch.
variables with number
Moderator: Martin
Re: variables with number
OK, so close to the end. It works like I wanted but, if I get a second message, the second list element is error
http://automagic4android.com/flow.php?i ... 8438ea3510
http://automagic4android.com/flow.php?i ... 8438ea3510
Re: variables with number
The condition to end the loop is probably off by one:
You are initializing the variable b with value 0 before the loop starts and increment b by one when the first message is read. The last condition of the loop uses following check:
b - 1 == length(text)
The list text contains only one element so the the script is evaluated like this:
1 - 1 == 1
which is false and makes the flow execute a second time but there's no second element in the list.
Following expression should work:
b == length(text)
Your lists with the sms text and the contact name are local so will always contain one element. You can change the names of the lists to global_text and global_name to make the lists available globally.
Automagic has a condition called Debug Dialog which greatly helps to debug a flow. The flow execution is paused when the condition is reached and a dialog with all local and global variables is shown. The Yes-button continues the flow on the true-branch of the condition and No continues the flow on the false-branch.
You are initializing the variable b with value 0 before the loop starts and increment b by one when the first message is read. The last condition of the loop uses following check:
b - 1 == length(text)
The list text contains only one element so the the script is evaluated like this:
1 - 1 == 1
which is false and makes the flow execute a second time but there's no second element in the list.
Following expression should work:
b == length(text)
Your lists with the sms text and the contact name are local so will always contain one element. You can change the names of the lists to global_text and global_name to make the lists available globally.
Automagic has a condition called Debug Dialog which greatly helps to debug a flow. The flow execution is paused when the condition is reached and a dialog with all local and global variables is shown. The Yes-button continues the flow on the true-branch of the condition and No continues the flow on the false-branch.