Message box choices are very confusing. Please help.

Post your questions and help other users.

Moderator: Martin

Econdoc
Posts: 153
Joined: 28 May 2016 20:06

Message box choices are very confusing. Please help.

Post by Econdoc » 06 Sep 2017 15:00

I could use some direction on what these message boxes really mean.
It is often VERY unclear what the choices mean. Here are a few examples…
Screenshot 7.png
Screenshot 7.png (88.49 KiB) Viewed 25285 times
[Reference the screenshot directly above.]1. Suppose that I add an action and choose from the existing action list. Let’s say that the existing action is a simple script with nothing in it but Sleep(1000). I now pick this script and change it to Sleep(2000). I now get a warning, to chose whether the script is for THIS USAGE or ALL USAGES. I can sort of figure out that I want to make the change for THIS usage, since I added the action here, but what does All Usages do? Will it change Sleep everywhere to Sleep(2000)?

[Reference the screenshot directly above.] 2. I had a script that contained only global_pname=”ABC” and the Default Name is checked. I added another script to the same flow which contained global_pname=”XYZ”. I got the messagebox above. The names of the two scripts are NOT the same. Why does this message appear? Since they are different scripts, why is this happening?

[Reference the screenshot directly above.] 3. I added a condition to a flow. The blue bar at the top says I have used the condition before and I can click for options. Why am I getting these choices? I want to use the same condition again. I don't get it.







Screenshot 6.png
Screenshot 6.png (78.76 KiB) Viewed 25285 times
[Reference the screenshot directly above.] 4. In this instance, I added a NEW script which contained only Sleep(1000); I now get the message box above. What am I overwriting if this is a NEW script? What does REUSE mean if this is a NEW script? This is very confusing! Why is it not possible to have 17 scripts that all do the same thing (e.g. Sleep(1000)) without these warnings?










Screenshot 8.png
Screenshot 8.png (107.89 KiB) Viewed 25285 times
[Reference the screenshot directly above.] 5. If the Default Name option is checked and the names are DIFFERENT, why is it necessary to change the name. I find that I have to UNCHECK Default name and give the action some other name in order to save the action/condition. I do not understand what is happening here.

-----------------------------------------------------------------------------
There must be some underlying logic to these messages, but I do not find the choices presented logical; I am mostly confused about what the consequences of a choice are. Please help. A CLEAR explanation would be great! :D

User avatar
Bluscre
Posts: 145
Joined: 31 Aug 2017 13:58
Location: Germany
Contact:

Re: Message box choices are very confusing. Please help.

Post by Bluscre » 06 Sep 2017 16:37

Imagine your Automagic's main storage like this.

As you see everything is in one big file, and if you create a new action in one of your scripts (Sleep(1000); for example) and the same action already exists why should it create a new one? What it does is referencing the already existing action in your new flow so it uses that.
Unofficial AutoMagic Telegram Group: https://t.me/automagicforandroid
Check out my other flows here: https://github.com/Bluscream/AutoMagicFlows or here.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Message box choices are very confusing. Please help.

Post by Desmanto » 06 Sep 2017 17:39

Finally, someone asking the real question. It has been asked before, but not until full blown questions like yours.:) I thought most of us figured it out by ourselves. I have get used to this, so no more annoyed by the prompt anymore. The following are translated from my own documentation in the other forum, with some modification.

The basic principle :
1. Automagic identifies each element (trigger, condition, action) by its name. So, you can't have two different elements with the same name but doing different things. One of them must be renamed to something else.
2. If you don't change default name, that is the name of the element. I usually leave it default as well, even when sharing the flow
3. Default name usually created using the element name + part of the option. Example : Sleep with 1 second and keep device awake, will have default name Sleep: 1s (keep device awake). This will vary depends on the element.
4. Some element don't have additional option, example : Clear Automagic Log. This element will have the same default name all the time.
5. Some element have too many options, but only one or two options participate in the default name. Example : Action Speech Output, has a lot of option : Voice, Audio Stream type, Text, Speech Rate, Pitch, Synthesis type and Options; but the one used in default name only Text.
6. The message prompt only appear when you have 2 elements doing the same thing or reused several times


Reuse/Overwrite
a. You made a new action Speech Output, Voice English, Text : Hello. Default Name : Speech Output: Hello
b. You open that action again, change the Text to Hello World. No prompt, unless you have ever made that action before. Default Name : Speech Output: Hello World
c. You create a new element, Speech Output, Voice Deutsch, Text : Hello World. The default name will be the same as above : Speech Output: Hello World. So when you save, there will be prompt to Reuse/Overwrite.
- Overwrite = Replace the b with c, so now the first and second element both using Voice Deutsch. (This replace all option, Voice is only example)
- Cancel = Cancel, so you can re-edit the name
- Reuse = Reuse the b option, Replace c with b, so now first and second both using English, even though just now you edit the voice to Deutsch.

In most cases, I usually choose Reuse, because most of the time I reuse a similiar action from other flow. But when you encounter something like this, where you have to speech output the same sentence in two different language, you should rename one of them to be different, example adding Deutsch at the end of c element. (will be explained in Change Name)


This Usage / All Usages
If you choose OverWrite (c replace b) or Reuse (b replace c), then you will have 1 element used 2 times. When you edit one of the element again (c), it will show the same as your first screenshot. This action is used 2 times. Click for options... If you click this blue bar, you will see the same prompt, stated which flow use this same element. The option
- This Usage : If you choose this, anything you edit to this element will be separated from the b. But if you don't change anything, it will still the same as b. So blue bar will appear again.
If you change the option Audio Stream Type to Notification, but the default name is still the same (you don't change the Text Hello World), then you will see the same prompt for Reuse/Overwrite. Same case for the first abc above.
- All Usages : Choose this and anything you edit to this element will be applied to every element (so b will change as well even you edit only c). Blue bar will stay, since b and c still the same.


Better use This Usage
Most of the time if you need to change something, you will just use This Usage. For example I just copied the Action Speech Output: Hello World, and wanna change it to Text Welcome. I would choose This usage, so now b has Hello World, but c has Welcome. If I choose All Usages, both b and c will have Welcome.

All Usage can be dangerous and possibly ruin your other flows. Example you have sleep action 10 seconds used 10 times in 10 different flow. Now you want to use sleep 1 second only, you wrong tap All Usages. Now all of your other flow will become sleep 1 second as well. I don't know the consequences, but it can be disastrous, all flow logic messed up, FUBAR. You can quickly fix this by changing it back to 10 seconds and tap All Usages again, but only if you remember the previous option. For Speech Output which has a lot of option, that can be missed easily. So, it is better to stick with This Usage in most cases. If it is the same element you refer to, there will another prompt to ask about the Reuse/Overwrite.


Change Name
Back to Speech Output again. Just now b and c is the same already, using English Voice and Text Hello World. Now you open c and change the voice to Deutsch. When you save, you will see the prompt just like your last screenshot.
- All Usages : the same as above, b and c now will changed to Deutsch.
- Change Name : is the one you need for this kind of same default name but different option. It force you to add something to the default name to make it different. In this case, you can add Deutsch, the name become : Speech Output: Hello World Deutsch.
Now b (English) and c (Deutsch) can exist together since c has additional name Deutsch at the end, b and c is different now.

Probably it is quite confusing to read this. You should try it out by yourself. Soon you will get used to it already.


==============================
Now I will answer your numbered question.
1. Yes, All Usages will change all other Sleep(1000) to Sleep(2000)
2. You probably copy the action or add action and choose directly from select an action; not using new. If you use new, this prompt won't appear. I always make it as a habit to choose new if I am going to make a completely different script.
3. That blue bar will always appear when there are same elements being used several times. Typically will appear on elements with no option, such as debug dialog. There is nothing you can do with that, it is by design. Unless you have time to change the name for each element usage, which is too troublesome.
4. As explained above. When you create new element with default name same as before one, you will be asked to Reuse/Overwrite. Most of the time, just Reuse. It is better to be wrong for this element only and re-edit the default name for this one only (to make it different); rather than choose overwrite, and change all of other usages to current one. It can be the same disaster as All Usages.
5. Change name indicate you have two element with same name but doing different action (as above, b is English, c is Deutsch, but both has same name). One of the them must be renamed to something else, just add some tag to the name to indicate the difference.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Econdoc
Posts: 153
Joined: 28 May 2016 20:06

Re: Message box choices are very confusing. Please help.

Post by Econdoc » 06 Sep 2017 18:52

Thank you both, Bluscre and Desmanto. Very very helpful answers from both of you.

I will have to study the very long and informative set of examples from Desmanto.

The table from Bluscre was also illuminating. How did you generate this table? That could be very useful!

User avatar
Bluscre
Posts: 145
Joined: 31 Aug 2017 13:58
Location: Germany
Contact:

Re: Message box choices are very confusing. Please help.

Post by Bluscre » 06 Sep 2017 18:54

Econdoc wrote:How did you generate this table?
https://automagic4android.github.io/flow
Unofficial AutoMagic Telegram Group: https://t.me/automagicforandroid
Check out my other flows here: https://github.com/Bluscream/AutoMagicFlows or here.

Econdoc
Posts: 153
Joined: 28 May 2016 20:06

Re: Message box choices are very confusing. Please help.

Post by Econdoc » 07 Sep 2017 00:01

Bluscre wrote:
Econdoc wrote:How did you generate this table?
https://automagic4android.github.io/flow
Sorry, but this is a dead link. I could not see anything by clicking on it.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Message box choices are very confusing. Please help.

Post by Desmanto » 07 Sep 2017 02:40

I think we should be careful when sharing our flow. I always double check and edit some of the info before publishing. The flows may contain our private information, or even worst, our username password. It has been warned inside automagic.
Econdoc wrote: Sorry, but this is a dead link. I could not see anything by clicking on it.
You have to backup all your flow to single xml and upload it to that url (or load the url of already uploaded xml). It will parse your xml and show it in table form.

I have some similiar flows to do the same, but not to parse into table. Instead it is used to help me create another flow : Flowception :)
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Bluscre
Posts: 145
Joined: 31 Aug 2017 13:58
Location: Germany
Contact:

Re: Message box choices are very confusing. Please help.

Post by Bluscre » 07 Sep 2017 06:32

Desmanto wrote:I think we should be careful when sharing our flow. I always double check and edit some of the info before publishing. The flows may contain our private information, or even worst, our username password. It has been warned inside automagic.
The website only uploads the file from your device to your browser, not to a webserver. So noone will ever know what you viewed there. Except you of course ^^
Unofficial AutoMagic Telegram Group: https://t.me/automagicforandroid
Check out my other flows here: https://github.com/Bluscream/AutoMagicFlows or here.

Econdoc
Posts: 153
Joined: 28 May 2016 20:06

Re: Message box choices are very confusing. Please help.

Post by Econdoc » 07 Sep 2017 10:22

"I have some similiar flows to do the same, but not to parse into table. Instead it is used to help me create another flow : Flowception"



Now I am intrigued! Where can I find Flowception?

User avatar
Bluscre
Posts: 145
Joined: 31 Aug 2017 13:58
Location: Germany
Contact:

Re: Message box choices are very confusing. Please help.

Post by Bluscre » 07 Sep 2017 14:10

I bet he hasn't uploaded it anywhere ^^
Unofficial AutoMagic Telegram Group: https://t.me/automagicforandroid
Check out my other flows here: https://github.com/Bluscream/AutoMagicFlows or here.

Post Reply