Can I change the format of TimeDate for Send Flows?

Post your questions and help other users.

Moderator: Martin

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

Can I change the format of TimeDate for Send Flows?

Post by Econdoc » 17 Oct 2017 13:52

I know that the timedate format is able to be modified in many ways. However, the "Send Flows/Widgets" option from the menu defaults to a format of yyyyMMdd. I would like to change this to MM-dd-yyyy. Is there a way to do this?

Thanks

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

Re: Can I change the format of TimeDate for Send Flows?

Post by Desmanto » 17 Oct 2017 16:06

What is the use case? If you simply want to rename the flow on the fly, you can create Automagic trigger Single Intent receiver. Parse the flow name and reverse it to the format you want, and share it again. This requires an additional tap to share to automagic intent receiver first and reshare again to the target app. (twice share)
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: Can I change the format of TimeDate for Send Flows?

Post by Econdoc » 17 Oct 2017 16:25

The use is from the 3 bar menu > Send flows/widgets. It is built into AM.
What is "intent"? I have no idea what it means or how to use it.

As always, thanks for your excellent help.

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

Re: Can I change the format of TimeDate for Send Flows?

Post by Desmanto » 18 Oct 2017 16:21

I mean the usage case such as you wanna send the xml to another phone and auto import it using the name of the exported xml. Or maybe stored in separate folder for backup. Because different usage will lead to different optimization of the flow.

Intent is the way android instruct/communicate internally to perfom something. In this case, I mean the Trigger Single Intent Receiver provided by Automagic (find it in trigger), to receive the file shared by user. When you send the flow, it will ask you to share to which app. You can find in the list, automagic intent at there. Choose that, and it will trigger the flow which has the Single Intent Receiver. (we must make the flow first)

I have made the flow and prooftest it. The exported flow will be save temporary in Automagic/temp_exported_data/flow_name_xxxx.xml. Using script regex, we can parse the name and yyyyMMdd at the name and reverse it back and add hyphen to it. After that, rename the file with new reversed name, share it again (start activity) to trigger the same send flow activity.

If you just wanna backup the flow with certain name, then we don't need to share it again; simply rename/move to the target folder. Or if it is to be attached to email, we can use another start activity to compose the email directly without the need to share manually again to email. That's why I need to know the specific usage case first.
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: Can I change the format of TimeDate for Send Flows?

Post by Econdoc » 19 Oct 2017 11:03

Thanks for the explanation of intent. It sounds quite complex and I don't think I followed it all. I will keep it in mind.

To your specific question about what I want to do: I want to use AM's menu to select "Send Flows/Widgets". When I pick that from the menu, a dropdown list of all my flows appears and any of my flows may be selected from the list. I can then send the selected flows to email, or save them to a folder, or send them to the cloud. However, no matter where I send the flow, the format is "flowsyyyyMMdd_HHmmss.xml" I would like to change the format of the filename that is being saved or sent.

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

Re: Can I change the format of TimeDate for Send Flows?

Post by Desmanto » 19 Oct 2017 17:09

I have created the flow here viewtopic.php?f=3&t=7037

I think this should be requested as feature, to set the default flow name when sharing. But for meanwhile, you can use my flow to auto rename all your flow before sharing it.
The downside is it requires you to share twice.
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: Can I change the format of TimeDate for Send Flows?

Post by Econdoc » 20 Oct 2017 11:14

Thanks, Desmanto. Your flow worked just the way I wanted.

As per your suggestion, I requested this as a feature to be added.
Thanks again for all your help. I would be lost without you.

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

Re: Can I change the format of TimeDate for Send Flows?

Post by Desmanto » 12 Jan 2018 15:15

I just realize there is better way to do it. We have action Export Flows/Widgets. We can choose the flow by parsing the data from the intent and then save it to Target file.
Or if you share only certain flow most of the time, we can just set the flow name there and set a shortcut to send flow. The filename of the shared flow can be customized as needed.
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: Can I change the format of TimeDate for Send Flows?

Post by Econdoc » 16 Jan 2018 00:10

Hello Desmanto,
You certainly are persistent :) I appreciate that you do not let go of a problem and are always trying to find better answers.
If it is not too much trouble, could you provide an example of how to use Export to accomplish this goal. I understood your other example of Send/Share but I do not have your experience and expertise in implementing some of these UNDOCUMENTED or poorly documented Automagic actions.

I keep wishing for a user manual or an internet location where I could look at other people's flows. As I am sure you know, it is difficult to view flows on the website. Just being able to VIEW a flow would be incredibly helpful. :( Examples of working flows are pure gold to those of us struggling use Automagic. The logic of working flows is extremely useful. If the logic works for one user, it probably will work for others.
Thanks as always.

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

Re: Can I change the format of TimeDate for Send Flows?

Post by Desmanto » 16 Jan 2018 15:58

Hehehe, I found it accidentally, while I am building the speech project to show off to my friend. It turns out I can actually make use of the flow for some occassion. Haven't finish it yet.

Do your use case still the same as above? select "Send Flows/Widgets", selecting flows/widgets and share it to somewhere? If yes, then my previous flow is enough. This won't speed up anything, as it still use the same concept of share twice. In fact, it will be much longer to use this export flows/widgets, since we have to parse the xml again to get the flows/widgets' names. While previous flow, just simply rename it.

This will benefit if you share only certain flows/widgets frequently. For example, you update/change the flow, and you want to send/sync this new updated/changed flow to your other device. The flow names are fixed, so you don't need to change the flow name variable anymore. There is no send intent involved.

=================
What you want is something like flow template for certain purpose. Example, navigation flow for example of GPS/maps usage. Geofencing flow for concept of checking our current location, entering and exiting. There are actually a lot of them already in my index. But yeah, most of the information are scattered pieces by pieces, even though I have grouped them based on their function. What we need maybe is something like a catalog of flow or maybe template of flow for certain purpose.

For script, Martin has put quite an example at the help : https://automagic4android.com/automagic ... mples.html
For intent, there are some examples also at the sticky thread.

I have several flow patterns those I use also for certain purpose. Some of them, I have shared in my index, such as the multiple choice, multi trigger, Control UI common practice, and several others. Sometimes I also forgot what I have typed if I don't really use it in my flow. I have downloaded some of great flows from other, just to remove them later because I don't need it. Everyone's need are different. That's why I keep the index to help searching the thread/post easier. I maybe don't need it now, but probably some time in the future. So you can try to see if there is something that can help a bit in the index.

==================
As for the undocumented elements, these ones need head banging to the wall :D. I have been banging my head for java for the last month. Still can't get most of the function to works as I wish, even though I have googled it out. I am planning to learn another java tutorial but specific for android. See if it can help a bit. But probably in mean time I will focus more on my speech flow project. Need to finish it, including testing before the end of month.

So keep trying by copying a working flow. See If you can get the result. Debug dialog is our best friend in this case. I have tried a lot of combination from different elements. I keep a group of flows solely for testing purpose. I have script test (coupled with debug dialog), Control UI, Ui event, HTTP, app, notification, toast, input dialog, widget, file operation and several others. These all have a lot of garbage (unused elements) inside, which i sometimes use only once and put aside to test another concept. Can be called as Automagic experiment lab :) It is from these tests I found most of the unique undocumented usage. Of course I test it because I need to prove my concept to see if I can make use of it in the flow. Example to test If I can put chinese/japanese character in JSON. Turn out it works! So Now I can use JSON or map using chinese/japanese char.
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.

Post Reply