If you search the group you will find this has this been asked several times and a few work around have been developed. I have made a camera folders/browser app (App factory) and along the way have tried most of them. So i thought I would post this for others and hopefully get some input...
The one I found to work the best was to use the 'file modified' context on DCIM/CAMERA. And then get the picture path from %FOTO. There have been reports in the past of the 'file modified ' context not working correctly on some devices but I found it to work every time on my device and 4 others (that's with a whole lot of testing).
However I hit a road block when I found out that one of the newer devices now saves its pictures on DCIM/100MEDIA. Not being able to use a variable in the 'file modified' context I now needed another work around. In addition with this method I was not able to have the user be able switch there camera path setting from internal to external memory ( again because of the 'no variable' restriction.
So I came up the the following profile and so far it seems to be working perfectly, however I have never used such a closed loop in tasker before and was hoping for some input from others as to any problems that might arise or suggestions. I set the priority high with the thinking that the only time this will be running is when the camera is on and I really do not think I need or want any other tasker tasks running at that time. I think there would be a remote chance of missing a picture if another task was running and I took a few pictures rapidly. In addition this is really just for the app where there will not be any other (unscheduled ) tasks competing .
Please post any comments or suggestions...
Thanks, Rich
I could not find any way to use %FOTO in a context so I put it in a task and basically set %FOTO to a variable (%Photo )then do a continuous loop checking to see if %FOTO has changed by setting it to another variable (%foto) then checking for %Photo !~ %foto. I needed to remove all of the '/' symbols from both variables in order to perform the match..
Profile: Photo (363)
Priority: 8 CoolDown: 0
State: Variable Value [ Name:%WIN Op:Matches Value:%Cameralabel ]
Enter: Photo (365)
<start>
A1: Anchor // start
A2: Stop [ With Error:Off Task: ] If [ %WIN !~ %Cameralabel ]
A3: Variable Set [ Name:%foto To:%FOTO Do Maths:Off Append:Off ]
A4: Variable Search Replace [ Variable:%foto Search:/ Ignore Case:On Multi-Line:On One Match Only:Off Store Matches In: Replace Matches:On Replace With: ]
// this removes all of the '/' from the variable to allow matching //
A5: Wait [ MS:542 Seconds:0 Minutes:0 Hours:0 Days:0 ]
// The profile works without this wait but it thought it was a good idea??? //
A6: Goto [ Type:Action Label Number:1 Label:start ] If [ %foto ~ %Photo ]
// It will stay in this loop until the %FOTO has changed or the %WIN value changes //
A7: If [ %foto !~ %Photo ]
A8: Copy File [ From:%FOTO To:%Picfilename Use Root:Off ]
A9: Variable Set [ Name:%Apicname To:%FOTO Do Maths:Off Append:Off ]
A10: Flash X [ Text: Pic saved ]
A11: End If
A12: Variable Set [ Name:%Photo To:%FOTO Do Maths:Off Append:Off ]
A13:
A14:
A15: Variable Search Replace [ Variable:%Photo Search:/ Ignore Case:On Multi-Line:On One Match Only:Off Store Matches In: Replace Matches:On Replace With: ]
// Again remove all '/' //
A16: Goto [ Type:Action Label Number:1 Label:start ]
> Everything else is the same.
> But the profile stopped working. I've been reading here for a whole day, but I just can't figure it..
Did it work at all after the changes?
Could you post the exported profile description of your changes?
To 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).
so it looks like this: Taken at 12:55, New York, 05.03.2015),
The symbols
: , .
Are not valid for file names.
PLEASE don't post XML in the body of your post. No one here can read it. If you need to include the XML, attach it as a file.
Is this a working version or does it still have issues?
> I've noticed it copies and renames only the latest pic, eg. if I open camera and take 3 photos, I can find only the last one in the folder set as destination folder..
>
That would make sense if the pics are taken in the minute of time because your naming scheme looks like it would give all three the same name..
, so it looks like this: Taken at 12:55, New York, 05.03.2015)
This is a fairly old post but this method worked flawlessly for me for a long time. I have since changed my approach because i found that if you have your camera app save the pics on the external sd card the %FOTO will not work. I will post my new approach here when i get a chance.
> This is a fairly old post but this method worked flawlessly for me for a long time. I have since changed my approach because i found that if you have your camera app save the pics on the external sd card the %FOTO will not work. I will post my new approach here when i get a chance.
Ok, here is my latest version, and a explanation of how it works.
Profile: Pic Taken 2 (793)
Priority: 8
Application: Camera
Enter: Pic Taken On (786)
A1: Write File [ File:timestamp.txt Text:a Append:Off Add Newline:On ]
Exit: Pic Taken 2 (776)
Run Both Together
<start>
A1: Anchor
A2: Variable Set [ Name:%ret To:
Do Maths:Off Append:Off ]
<find files>
A3: Run Shell [ Command:find %DCIM_path -newer /storage/sdcard0/timestamp.txt Timeout (Seconds):0 Use Root:Off Store Output In:%picpath Store Errors In: Store Result In: ]
A4: Variable Add [ Name:%count Value:1 Wrap Around:0 ]
A5: Goto [ Type:Action Label Number:1 Label:find files ] If [ %picpath !Set & %count < 3 ]
A6: Stop [ With Error:Off Task: ] If [ %picpath !Set ]
A7: Variable Search Replace [ Variable:%picpath Search:%ret Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In: Replace Matches:On Replace With: ]
A8: Variable Split [ Name:%picpath Splitter:/ Delete Base:Off ]
A9: Variable Set [ Name:%index To:%picpath(#?*jpg*) Do Maths:Off Append:Off ]
A10: Variable Split [ Name:%index Splitter:, Delete Base:Off ]
A11: For [ Variable:%item Items:%index(:) ]
<copy>
A12: Copy File [ From:%DCIM_path%picpath(%item) To:%Picfilename Use Root:Off Continue Task After Error:On ]
A13: End For
Explanation: The issue I had the most difficulty with was getting this to work for pictures taken in rapid succession. This was what I came up with. It uses the shell command "find" in the exit task to get a list of the file names that have been created since the enter task ran. This has been tested and so far works flawlessly..
Profile: Pic Taken 2 (793)
Priority: 8
Application: Camera
Enter: Pic Taken On (786)
A1: Write File [ File:timestamp.txt Text:a Append:Off Add Newline:On ]
/// This action is used to make a time stamp of when the enter task was run. The contents of the file are not used, just the creation time is used. The "find" command in the exit task uses the creation time of this file as the start time of its search and the current time as the end time of its search. //
Exit: Pic Taken 2 (776)
Run Both Together
/// It is important to set the task collision to "Run Both Together" in the task properties. (When in the task edit screen it is the three slider icon in the lower right)///
<start>
A1: Anchor
A2: Variable Set [ Name:%ret To:
Do Maths:Off Append:Off ]
/// This sets %ret to a 'carriage return' or 'line feed' . Just type a actual return in the TO: option. ///
<find files>
A3: Run Shell [ Command:find %DCIM_path -newer /storage/sdcard0/timestamp.txt Timeout (Seconds):0 Use Root:Off Store Output In:%picpath Store Errors In: Store Result In: ]
/// this gets a list of file names created since the enter task ran and puts it in %picpath
A4: Variable Add [ Name:%count Value:1 Wrap Around:0 ]
A5: Goto [ Type:Action Label Number:1 Label:find files ] If [ %picpath !Set & %count < 3 ]
/// these 2 actions just loop the "find" command 3 times if the variable is not set. This gives the camera time to save all of the taken pictures. ///
A6: Stop [ With Error:Off Task: ] If [ %picpath !Set ]
/// This will stop the task if there are no pictures taken ///
A7: Variable Search Replace [ Variable:%picpath Search:%ret Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In: Replace Matches:On Replace With: ]
/// The list has multiple return in it. This removes the returns. ///
A8: Variable Split [ Name:%picpath Splitter:/ Delete Base:Off ]
/// This splits the file names into an array ///
A9: Variable Set [ Name:%index To:%picpath(#?*jpg*) Do Maths:Off Append:Off ]
/// this gets the indices of the file names that are pictures. To rule out any videos ect. ///
A10: Variable Split [ Name:%index Splitter:, Delete Base:Off ]
/// this splits the indices to be used in the for loop ///
A11: For [ Variable:%item Items:%index(:) ]
<copy>
A12: Copy File [ From:%DCIM_path%picpath(%item) To:%Picfilename Use Root:Off Continue Task After Error:On ]
A13: End For
/// the for loop copies the files from the DCIM camera file to the folder name in %:Picfilename ///
Hope someone finds some of this helpfull....