Add action (Rename file)

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Add action (Rename file)

Post by MURTUMA » 15 Jul 2016 21:29

wfrcrd wrote:it's not so simple to me to translate the xml text to a flow interface
Did you open the link with a browser or perhaps download the xml text file? You should open the link with Automagic and it will do the translation for you.

User avatar
Bushmills
Posts: 286
Joined: 23 Sep 2014 21:56

Re: Add action (Rename file)

Post by Bushmills » 16 Jul 2016 15:40

"Move files" action allows globs (wildcards), for specification of group of files - for example, all those matching a specific extension -, while as destination, a directory may be specified. That way can you move many files with one action to another directory, without the need to know their names.

wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Re: Add action (Rename file)

Post by wfrcrd » 17 Jul 2016 09:22

I've imported the xlm file into Automagic so I've seen the flow.
A bit more clear but there's a lot of stuff for programmers, wich I'm not.

So I'd be really glad if someone of you could create a flow and put here the xlm file here,
it soudl be so easy for you,
then it could be more and more easy to me to understand ( and finally use it !).

A simply pourpose of the flow could be:
1) monitor the directory A and start when a new file is created there (there is the proper trigger)
2) move that file from the directory A to directory B and add a suffix called "_MOVED"

so if the the name of the file is "file.name" the finally name file on the B directory should be "file.name_MOVED"

I'm asking too much?

Anyway thank you in advice.

User avatar
kintrupf
Posts: 257
Joined: 10 Sep 2013 08:59

Re: Add action (Rename file)

Post by kintrupf » 18 Jul 2016 07:28

That is actually very simple to do, you only need the trigger you've mentioned and one additional action ;)

Take a look at the attached flow. In the action Move File I used the variables from the File Observer trigger to move any new camera picture to the root of the user storage and add the „_MOVED“-suffix.
Attachments
flow_Move_new_images_20160718_091927.xml
(1.81 KiB) Downloaded 891 times

wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Re: Add action (Rename file)

Post by wfrcrd » 18 Jul 2016 17:41

Well thank you!

The flow works good but how can I move it to a different directory wich already exist?

I've tried some modifications but not results (just a bad loops)

I can't still understand the expression :

what does it means this?
{registered_path}/{path}

because
{MickeyMouse}/{Mouse} don't work, so
where I can find the right words and their meanings?

Thank you!

User avatar
kintrupf
Posts: 257
Joined: 10 Sep 2013 08:59

Re: Add action (Rename file)

Post by kintrupf » 19 Jul 2016 06:41

wfrcrd wrote:what does it means this?
{registered_path}/{path}
The part inside the curly braces is where the magic happens :mrgreen:
These are the so called "variables" and they are filled in by the trigger.
{registered_path} is the path which is monitored by the trigger and {path} is the file that has actually triggered the action (in this case the newly created image file).
So {registered_path}/{path} is the complete path of the file that has triggered the action.

If you look at the target path of the Move File action you'll see "/storage/emulated/0/{path}_MOVED". {path} will be replaced internally with the actual name of the file.
So if you want to change the destination path you'll have to replace "/storage/emulated/0/" with something else.

To learn about the variables that are provided by a trigger open the trigger's options and press the "?" button in the top right corner. The help text lists all variables which are created by the trigger.

wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Re: Add action (Rename file)

Post by wfrcrd » 21 Jul 2016 07:48

When i tap the ? symbols it tell me that the guide it's not available, and it happens always.

Anyway finally it works, thank you.

One step ahead: to monitor more than one directory and tu move the files to the same directory (from A or B, both to C)
may I use the same flow or it's better to create another flow?

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Add action (Rename file)

Post by MURTUMA » 21 Jul 2016 09:36

wfrcrd wrote:When i tap the ? symbols it tell me that the guide it's not available, and it happens always.
The guide needs an internet connection. Have you blocked that by chance? When you are viewing the guide, you can download it through menu to be able to see it offline. If Automagic IS connected and you are still unable to view the guide, you should open a thread about that in the bug report forum here.

Also, you can view the exact same guide here: http://automagic4android.com/en/help
The subsections, triggers, conditions and actions contains explanations for every element in AM.

User avatar
kintrupf
Posts: 257
Joined: 10 Sep 2013 08:59

Re: Add action (Rename file)

Post by kintrupf » 21 Jul 2016 11:05

wfrcrd wrote:One step ahead: to monitor more than one directory and tu move the files to the same directory (from A or B, both to C)
may I use the same flow or it's better to create another flow?
You can use the same flow!
Tap on the trigger icon in the flow, then tap on the menu button on top, then select New to add another trigger.
Add a new File Observer and fill in the second path to monitor (and set any other required options). You don't need to change the attached Move File action.
The flow will now be triggered by either of the two triggers!
The subsequent action Move File is executed with the variables filled by the trigger that actually started the flow.

wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Re: Add action (Rename file)

Post by wfrcrd » 21 Jul 2016 20:55

Thank you another question a bit OT :
more triggers and more flows means more battery drain or not?

Locked