Move files with tasker

6901 views
Skip to first unread message

Paulo Paulo

unread,
May 28, 2012, 12:13:22 PM5/28/12
to Tasker
Hi.
I have some tasker profiles that record sound and take pictures in
some phone actions.
but I would like tasker to move those pictures from sdcard/DCIM/Tasker
to another folder and all the .3gp sound files from the root of sdcard
to another folder too.
I can't find a way of automatize that task. for a well known file it's
quite easy but all those files are crated with variabes to date and
time , so all have diferent names.
is there a already made profile for this task?
sorry I'm a noob with tasker
thanks in advance

Manu Pinazo

unread,
May 29, 2012, 1:41:55 AM5/29/12
to tas...@googlegroups.com
I have a profile that moves files from different camera apps to folder in DCIM, this is the loop I use for moving the files:

List files Dir origin/dir Variable %dirfiles
for %dirfile items dirfiles()
    move from %dirfile to destination/dir
end for

You can match for a specific mask on files (like *.3gp)

Paulo Paulo

unread,
May 30, 2012, 6:58:30 AM5/30/12
to Tasker
hi Manu

how can I import this profile or insert it in my tasker app.
I sorry to be so ignorant with tasker but I'm just starting to
operating with tasker.

bourne-nolonger

unread,
May 30, 2012, 1:18:16 PM5/30/12
to tas...@googlegroups.com
Hey Paulo Paulo,

Manu actually described how to create the profile.
It is a little confusing at first, but if you look at the example he gave you can actually figure it out.
It helps though if you understand scripting a little.

1)
Under the "Profiles" tab in Tasker create a profile and call it whatever you like.

2)
Assign a context to this profile.
For me I assigned a time of day for the profile to be triggered.

3)
Create a new task.
I called mine "MoveWallper" since I want to move wallpapers around that I have downloaded from the app Wallbase

4)
Now edit this newly created task.
In edit move hit the "+" sign
In the "Select Action Category" menu select the following: File> List Files
> In the "List Files" menu under "Dir" hit the Magnify glass and select a directory
> In the "Variable" section type in some variable - Mine looked like this %FilesToMove
Then hit the Green Check Mark

5)
Hit the "+" sign again
In the "Select Action Category" menu select the following: Task > For
In the "For" menu under "Variable" create a new variable name - Mine looked like this %FilesToMoved
> In the Items box type the name of the variable you created in step 4 followed by an open and closed curved bracket - Mine looked like this %FilesToMove()     - NOTE - I think I messed up on adding the % in the Items box. Mine works with it, but I don't think you need to specify it.
Then hit the Green Check Mark

6)
Hit the "+" sign again
In the "Select Action Category" menu select the following: File > Move
In the "Move"" menu under "From" use the new variable name created in step 5 - Mine looked like this %FilesToMoved
> In the "To" box hit the magnify glass and select your destination directory.
Then hit the Green Check Mark

7)
Hit the "+" sign again 
In the "Select Action Category" menu select the following: Task > End for
Then hit the Green Check Mark 

Then you are pretty much done.
Think you have to hit the Green Check Mark once more to save your changes.
Then you can test your task to see if it does what you want.

This is what I did anyway and it appears to be working.
I am still pretty new to tasker so I definitely might have messed something up.
Give it a try though and just see if you can get it working.

Cheers

Manu Pinazo

unread,
May 31, 2012, 2:21:06 AM5/31/12
to tas...@googlegroups.com
You can't import it automatically, it's a transcript of the diferent actions/parameters you must use.
Just search them in the list of tasker actions and add them one by one to your task modifying to suit your needs

Paulo Paulo

unread,
May 31, 2012, 10:21:21 AM5/31/12
to Tasker
great tutorial guys
thanks a lot... tasker rules ;-)

Manu Pinazo

unread,
May 31, 2012, 12:43:51 PM5/31/12
to tas...@googlegroups.com
Great tutorial bourne-nolonger!
I don't know why your message didn't appeared to me when I answered this morning, your answer is far better than mine xD

Anyway I'm glad if it helped you both :-)

Paulo Paulo

unread,
Jun 1, 2012, 4:03:28 AM6/1/12
to Tasker
Hi guys
I followed those steps to create the profile but I'm stuck

it gives me a message:

"failed to rename /dev to mnt/sdcard/Tasker/dev"


As I want to move .3gp files fom the sdcar root to Tasker folder
but using the magnifiing glass icon if I chose sdcard folder as from
it gives me a blanc path with notinhg in it.
my phone is rroted... is ther any issues about paths with rooted
phones with tasker?

regards
Message has been deleted

bourne-nolonger

unread,
Jun 4, 2012, 12:38:00 PM6/4/12
to Tasker
@Manu Pinazo
Thanks man!
It was you though that showed me how to get it to work so all the
credit goes to you! I just expanded on your example a little.

When I first checked my post didn't show either, I am glad I wasn't
the only one :D

@Paulo Paulo

Sorry for the late response.
That is sort of weird the error you are getting.
Would you be able to provide me with the exact paths you are using?
I can give it a try on my device and see if I get the same issues.

Being rooted I don't think should make a big difference.
If anything you would have less issues because you have access to
everything
when you have root access.

It sounds like maybe though that you haven't picked a correct task.
Judging by the message
it sounds like the system is in fact trying to rename files instead of
moving them. Which makes me
think that maybe you have your target and destinations set to be the
same (At least if the unix/Linux world
the move command can be used to rename files). I am probably way off,
but I thought I would add it.

Anyway, if you can provide the exact paths you are using I can try and
give it a go on my device.

Cheers

aritafari

unread,
Aug 25, 2012, 12:39:13 PM8/25/12
to tas...@googlegroups.com
This works. Thanks
Yes, you do need % in the Item Box. Mine didn't work until I added it.

On Wednesday, May 30, 2012 10:18:16 AM UTC-7, bourne-nolonger wrote:
Hey Paulo Paulo,

Jos Quinten

unread,
Oct 10, 2012, 9:34:35 AM10/10/12
to tas...@googlegroups.com
Same problem over here "Failed to rename..."

Op vrijdag 1 juni 2012 10:03:28 UTC+2 schreef Paulo Paulo het volgende:

Richard Davis

unread,
Oct 10, 2012, 9:55:49 AM10/10/12
to tas...@googlegroups.com

If you are trying to access your sdcard-ext   Then do not use the mag glass just type in (or use a variable set to) 

../sdcard-ext/

This is a known bug..
Google decided to change things... I believe it is on pents to do list..

Pent

unread,
Oct 10, 2012, 10:39:44 AM10/10/12
to Tasker
> Google decided to change things... I believe it is on pents to do list..

About to look at that.

Pent
Message has been deleted

Pete S

unread,
Dec 16, 2012, 6:33:22 PM12/16/12
to tas...@googlegroups.com
Great tutorial. Got it up and running. Is there a way to specify only move jpg files? I put the (*.jpg) and it didn't work. Any thoughts?

Richard Davis

unread,
Dec 16, 2012, 7:19:55 PM12/16/12
to tas...@googlegroups.com

> Great tutorial. Got it up and running. Is there a way to specify only move jpg files? I put the (*.jpg) and it didn't work. Any thoughts?

Where did you put the (*.JPG)   It should go into the 'match' of the 'list files'  it looks like it should work...

Pete S

unread,
Dec 16, 2012, 7:46:52 PM12/16/12
to tas...@googlegroups.com
This is the error message I'm getting and the profile.
IMG_20121216_194223.JPG
IMG_20121216_194538.JPG

Richard Davis

unread,
Dec 16, 2012, 8:05:35 PM12/16/12
to tas...@googlegroups.com

I was confused by your post that said 'got it up and running '   what did you get running?

You can't put the (*.jpg) in the for loop.   It needs to into the 'match' parameter of the 'list files' action. 

It is also easier to help, if you simply long press on the profile name and select export / export to clipboard. And paste it here instead of the screen shots. 

Pete S

unread,
Dec 16, 2012, 8:09:21 PM12/16/12
to tas...@googlegroups.com
I have it working for any files. I want it to only transfer jpg files.


<TaskerData sr="" dvi="1" tv="1.3.3u2m">
<Task sr="task21">
<cdate>1355683365895</cdate>
<edate>1355706520936</edate>
<id>21</id>
<nme>Move Wallpaper</nme>
<pri>10</pri>
<Action sr="act0" ve="3">
<code>412</code>
<lhs>%FilesToMove</lhs>
<op>1</op>
<rhs>*.JPG</rhs>
<se>false</se>
<Str sr="arg0" ve="3">Download</Str>
<Str sr="arg1" ve="3"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3">%FilesToMove</Str>
</Action>
<Action sr="act1" ve="3">
<code>39</code>
<Str sr="arg0" ve="3">%FilesToMove</Str>
<Str sr="arg1" ve="3">%FilesToMove()</Str>
</Action>
<Action sr="act2" ve="3">
<code>400</code>
<se>false</se>
<Str sr="arg0" ve="3">%FilesToMove</Str>
<Str sr="arg1" ve="3">Wallpaper</Str>
<Int sr="arg2" val="0"/>
</Action>
<Action sr="act3" ve="3">
<code>40</code>
</Action>
</Task>
</TaskerData>

Richard Davis

unread,
Dec 16, 2012, 8:20:19 PM12/16/12
to tas...@googlegroups.com

Sorry, I meant export / "description to clipboard."..

not xml 

Pete S

unread,
Dec 16, 2012, 8:24:11 PM12/16/12
to tas...@googlegroups.com
I got it to work once. Now it's giving me an error saying the file it moved is missing. It doesn't move any jpg still


Profile: Move Wallpaper (2)
Time: From 20:19 Till 20:20
Enter: Move Wallpaper (21)
A1: List Files [ Dir:Download Match: Include Hidden Files:Off Variable:%FilesToMove ] If [ %FilesToMove ~ *.JPG ]
A2: For [ Variable:%FilesToMove Items:%FilesToMove() ]
A3: Move [ From:%FilesToMove To:Wallpaper Use Root:Off ]
A4: End For

Richard Davis

unread,
Dec 16, 2012, 8:33:55 PM12/16/12
to tas...@googlegroups.com

In the 'list files' action there is a "MATCH" category.  That is where the '*jpg' should go.  Not the 'if' section...

Pete S

unread,
Dec 16, 2012, 8:43:52 PM12/16/12
to tas...@googlegroups.com
Updated that. I'm still getting the error message that the only file i was able to transfer is missing. No other files are transfering


Profile: Move Wallpaper (2)
Time: From 20:19 Till 20:20
Enter: Move Wallpaper (21)

A1: List Files [ Dir:Download Match:*.JPG Include Hidden Files:Off Variable:%FilesToMove ]

Richard Davis

unread,
Dec 16, 2012, 8:54:40 PM12/16/12
to tas...@googlegroups.com

Looks like you have capitals in your *. Jpg    I think they should be lower case..    

Pete S

unread,
Dec 16, 2012, 9:00:17 PM12/16/12
to tas...@googlegroups.com
Changed that up. Still getting the same error message. Should I rebuild the profile?

Richard Davis

unread,
Dec 16, 2012, 10:34:28 PM12/16/12
to tas...@googlegroups.com

> Profile: Move Wallpaper (2)
>         Time: From 20:19 Till 20:20
> Enter: Move Wallpaper (21)

You might need a 'array clear %FilesToMove' at the beginning because this is a global variable..

>         A1: List Files [ Dir:Download Match: Include Hidden Files:Off Variable:%FilesToMove ] If [ %FilesToMove ~ *.JPG ]

I do not think you want these variables to be the same and i would suggest using local variables whenever possible ..

>         A2: For [ Variable:%FilesToMove Items:%FilesToMove() ]

Try      A2: For( variable.%movefile items:%FilesToMove() )

>    try  A3: Move [ From:%movefile To:Wallpaper Use Root:Off ]

>         A4: End For

If you still get the error check in the variables tab and see what the values for the array are, the error means %FilesToMove(0) is not being set. 

Pete S

unread,
Dec 17, 2012, 2:41:52 PM12/17/12
to tas...@googlegroups.com
I got it working! I changed the FileToMove to WPmove. Making it local rather than global. (I guess) Good call on that. I didn't have to use the array.

Again, I'm new to tasker so I'm still getting the hang of it. I REALLY appreciate your help. Thanks for staying with me.

Richard Davis

unread,
Dec 17, 2012, 3:48:47 PM12/17/12
to tas...@googlegroups.com


> I got it working!

Great..

I changed the FileToMove to WPmove.

To make it local you need make ALL the letters lowercase %wpmove
Read the user guide under variables for more info you should know..

I didn't have to use the array.

You will not have to  if you make all the variables local, but if you leave %WPmove a global then the array will not clear and if the next file list is shorter than the first you will probably get a error..

>
> Again, I'm new to tasker so I'm still getting the hang of it. I REALLY appreciate your help. Thanks for staying with me.

Happy to help.. if you have not done so you should read the beginners guide and the user guide.. there is alot of great and necessary information in them.. 

Rich....

Alex Gurduiala

unread,
Feb 27, 2014, 9:41:11 PM2/27/14
to tas...@googlegroups.com
Did you ever find a way to get around 'Failed To Rename'
 
Thank you

Enrico

unread,
Jun 10, 2014, 8:22:33 AM6/10/14
to tas...@googlegroups.com
Hi everyone,
I found this old post and I see that the procedure works within the internal storage (moves correcly from DCIM to whatevet folder), but it gives "the rename" error while I try to move from Internal to Ext SD card; I have tried all the possible directory path (eg: /storage/Extsdcard/folder or ../../extsdcard/folder or using the magnifiing glass icon to browse the target folder; I have also tried both with root and non root option checked.

I have kitkat 4.4.2, rooted.
Has someone a solution?
Did someone test it?

Thanks,
Enrico



1)
Under the "Profiles" tab in Tasker create a profile and call it whatever you like.

2)
Assign a context to this profile.
For me I assigned a time of day for the profile to be triggered.

3)
Create a new task.
I called mine "MoveWallper" since I want to move wallpapers around that I have downloaded from the app Wallbase

4)
Now edit this newly created task.
In edit move hit the "+" sign
In the "Select Action Category" menu select the following: File> List Files
> In the "List Files" menu under "Dir" hit the Magnify glass and select a directory
> In the "Variable" section type in some variable - Mine looked like this %FilesToMove
Then hit the Green Check Mark

5)
Hit the "+" sign again
In the "Select Action Category" menu select the following: Task > For
In the "For" menu under "Variable" create a new variable name - Mine looked like this %FilesToMoved
> In the Items box type the name of the variable you created in step 4 followed by an open and closed curved bracket - Mine looked like this %FilesToMove()     - NOTE - I think I messed up on adding the % in the Items box. Mine works with it, but I don't think you need to specify it.
Then hit the Green Check Mark

6)
Hit the "+" sign again
In the "Select Action Category" menu select the following: File > Move
In the "Move"" menu under "From" use the new variable name created in step 5 - Mine looked like this %FilesToMoved
> In the "To" box hit the magnify glass and select your destination directory.
Then hit the Green Check Mark

7)
Hit the "+" sign again 
In the "Select Action Category" menu select the following: Task > End for
Then hit the Green Check Mark 
Message has been deleted

praveentom

unread,
Jan 27, 2015, 7:53:41 PM1/27/15
to tas...@googlegroups.com
Hi... I had the same issue... resolved it... by using copyfile function in tasker the file and then deleting it.. instead of move... 
Reply all
Reply to author
Forward
0 new messages