> I've attached a screenshot of what I've done ion Tasker - can anyone shed any light on what's going wrong?
Could you post your profile or task here... Long press on the profile or task name / ( 3 dot menu with 4.0+ ) export / export "DESCRIPTION" to clipboard (not XML)
Any linked tasks will be exported with the profile they are linked to..
To be able to export, The beginner mode needs to be off and the profile needs to be named by you (Not the Tasker listed name. Tasker will list your profile with the context name if you have not given it one).
> Thanks for the reply. Here's the task
2 issues...
1- You have a space in your %files () . It should be %files() in action A3
>
> MoveFiles (5)
> A1: List Files [ Dir:WhatsApp/Media/WhatsApp Images Match:*. jog Include Hidden Files:Off Use Root:Off Variable:%files ]
> A2: Flash [ Text:Moving files Long:Off ]
///////
Here..
> A3: For [ Variable:%file Items:%files () ]
////////
> A4: Move [ From:%file To:/storage/sdcard1/DCIM/100ANDRO Use Root:Off ]
> A5: End For
>
>
>
2- from the user guide..
Move
Move an SD card file or directory to a new directory.
If To specifies an existing file, it will be overwritten.
The paths start in the root directory of the SD card.
//////////
Note: files cannot be moved from one file system to another e.g. internal memory to SD. A workaround is to Copy and then Delete.
///////////
> Odysseos (or anyone else who reads this): I tried to follow your instructions but noticed that in your code 'Root' is on. I haven't rooted my phone - is this necessary to move the files as I've described in my OP?
>
Afaik, Root is not required for this. Is it not working for you? The only one thing i would change would be the match. I think * means something has to be there, so I would change the match in the files list action to *.jpg
Oh, one more thing. There is no reason to use a global variables in this task. It will slow thing down and leave you with a global array you do not need. I would go back to the local variables you used in your original task.
If you are still having problems, post what you have so far.
CooyDelete (6)
A1:
List Files [ Dir:WhatsApp/Media/WhatsApp Images Match:*. jpg Include Hidden
Files:Off Use Root:Off Variable:%Whupfiles ]
A2:
For [ Variable:%Whupfiles Items:%Whupfiles() ]
A3: Copy File [ From:%Whupfiles To:/storage/sdcard1/DCIM/100ANDRO Use Root:Off ]
A4:
Flash [ Text:%Whupfiles Long:Off ]
A5:
Delete File [ File:%Whupfiles Shred Level:0 Use Root:Off ]
A6:
End For
You need to pay attention to the extra white spaces. It is most likely your chosen keyboard putting them in.
Your match in A1 has a extra space. *. Jpg. Should be *.jpg
You should also use local variables. Like the ones in your first profile. A local variable only has lowercase letters. A global variable has one or more capitol letters. They are explained in the user guide.
You will want to copy your pics and save them with a file browser until you confirm this works as expected. It should work fine but you want to always be carful when using the delete files action.
I would recommend disabling the delete file action untill you make sure the copy files work as well. To disable a action, Long click on the action / disable
Here is a edited version
>
> CooyDelete (6)
> A1: List Files [ Dir:WhatsApp/Media/WhatsApp Images Match:*.jpg Include Hidden Files:Off Use Root:Off.Variable:%files ]
>
> A2: For [ Variable:%file Items:%files() ]
> A3: Copy File [ From:%file To:/storage/sdcard1/DCIM/100ANDRO Use Root:Off ]
>
> A4: Flash [ Text:%file Long:Off ]
> A5: Delete File [ File:%file Shred Level:0 Use Root:Off ]
> A6: End For
>
Hello Rich D, Hi all
> OK, started from scratch with a new task, still doesn't work, still getting a red dot on A3 with no pop-up explanation. Have checked my code, cannot see anything wrong.
To get a pop up error you need to enable them in the tasker preferences. You will only see these errors when you re-enter the tasker UI after the error has occurred. This is the best way to find issues with file operations.
>
> Appreciate all the help. Starting to think it's not actually possible to do what I want with Tasker and WhatsApp......
Nahh... this should be easy.
Try flashing %files() just after A1
Make sure "
> OK, started from scratch with a new task, still doesn't work, still getting a red dot on A3 with no pop-up explanation. Have checked my code, cannot see anything wrong.
To get a pop up error you need to enable them in the tasker preferences. You will only see these errors when you re-enter the tasker UI after the error has occurred. This is the best way to find issues with file operations.
>
> Appreciate all the help. Starting to think it's not actually possible to do what I want with Tasker and WhatsApp......
Nahh... this should be easy.
Try flashing %files() just after A1
Make sure " /storage/sdcard1/DCIM/100ANDRO " is the correct path.
Make sure you are backing all the way out of tasker with the back button after making changes.
How are you starting this task?
> "/storage/sdcard1/DCIM/100ANDRO" is the path I chose as it's the location where the photos are stored from the camera, as shown by looking at the file path within Album according to details.
If you have not done so already, use the mag glass in the copy file action to select the receiving folder.
Did you enable 'pop up errors' in the tasker preferences?
What version of Android? I didn't see that mentioned. In KitKat, Google has added restrictions preventing apps from writing to folders on the external sdcard that are not owned by that app. This can be overcome with root access. In lollipop it has been changed again, making it a bit easier, but still different than earlier versions of Android.
Scott
Change your target path to point to your internal sdcard instead of external, and see if it works. At least you can validate your task.
There is a way to write to external storage without root, but it can be cumbersome. If you create Tasker's private folder, you should be able to write to that. But I think it either needs to exist before installing Tasker, or Tasker needs to create it, which you might be able to do with another task. I'm not certain of the exact path, but it would need to be something like /storage/sdcard1/Android/data/net.dinglisch.android.tasker. Do a Google search about writing to external storage in KitKat and you should find some information about it.
You can also try to make Tasker a system app, but that would also need root, and comes with its own share of problems. System apps are able to write to external storage without restriction.
Once you get to lollipop, you will need to grant permission to Tasker to write to external storage, then it should work. At least that's how I understand it. I'm not there yet, so I don't have specific experience about it.
One last comment. It might be easier to root your phone on KitKat than it will be on lollipop, but I don't know your device. You would need to do some research about that on your own.
Scott
Thanks Scott. I'm on a Sony Z3 with 4.4.4 and apparently Lollipop any day now.
Hmm. Are you saying that I currently would need to root the phone first? And maybe in the future with Lollipop root wouldn't be necessary? If that were the case I'd wait for Lollipop and if not then just root it.
--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.