> I'm using tasker's auto share extension to share a pic to tasker from gallery to perform some tasks on the folder containing that picture..
> When shared, tasker receives the uri of the pic in this form "content://media/external/images/media/xxx" and so I need a way to convert it to the real absolute path..
I had the same problem. Unfortunately I forgot how I fixed it...:( I just checked my profile and I think if you try the auto command feature it might work. It adds I additional step to the process but that is what I am currently using and I get the actual file path.
Give it a try and let me know.
Rich....
Here is a export of my working profile. I am sharing the pics from Quickpics.
Profile: Share Pics2 (348)
State: AutoShare [ Configuration:Command: copy pics
Sender: all
Subject: all
Text: all
Image: all ]
Enter: Share Pic On2 (349)
A1: Hide Scene [ Name:File Browser2 Continue Task After Error:On ]
A2: Variable Clear [ Name:%Reload Pattern Matching:Off ]
A3: Variable Clear [ Name:%Filestomove Pattern Matching:Off ]
A4: Variable Set [ Name:%splitter To:content://com.alensw.PicFolder.FileProvider Do Maths:Off Append:Off ]
A5: For [ Variable:%image Items:%asfile() ]
A6: Variable Split [ Name:%image Splitter:%splitter Delete Base:On ]
A7: Variable Set [ Name:%Filestomove To:%image(2), Do Maths:Off Append:On ]
A8: End For
A9: Go Home [ Page:3 ]
A10: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A11: Show Scene [ Name:File Browser2 Display As:Activity, Full Window Horizontal Position:100 Vertical Position:100 Show Exit Button:On Continue Task Immediately:On ]
OK.... I did some testing.. I could not get the correct file path with the gallery either, With or without the command option. It does however work with quickpics. Which in my opinion is a far better pic viewer. Sorry for any misinformation ....
Rich...
import android
droid = android.Android()
uri = 'content://your/uri/here'
filepath = droid.queryContent(uri, ['_data'] ).result[0]['_data']
print filepath