...how can i make the share button pull the last created file after using the 'say to file' action?
Now it goes like this:
The task says to file a text from a dynamic value and then goes to a specific directory, the files names get to be:
Directory/%DATE-%TIME-%TIMES.wav
And thats in order to have different names for each file created and prevent overwrite to older files (unlike the 'take photo' action which give you an option to name files in a sequence automatically)
After its done the share popup will open to choose with which app and it will attach the audio file using send share intent and using:
MIME type: audio/*
Extra: directoory/%mostrecentfile
Now i'll implant this and comme with feedback unless you have any comment And again thanks for the great support!
Save And Share (203)
A1: Flash [ Text:Saving and sharing... Long:Off ]
A2: Say To File [ Text:RandomText Engine:Voice:default:default File:VoiceDir/%DATE-%TIME-%TIMES.wav Pitch:5 Speed:5 Continue Task Immediately:Off ]
A3: For [ Variable:%thisfile Items:VoiceDir ]
A4: Test [ Type:File Modified Data:%thisfile Store Result In:%thistime ]
A5: If [ %thistime > %mostrecenttime ]
A6: Variable Set [ Name:%mostrecenttime To:%thistime Do Maths:Off Append:Off ]
A7: Variable Set [ Name:%mostrecentfile To:%thisfile Do Maths:Off Append:Off ]
A8: End If
A9: Flash [ Text:%mostrecentfile Long:Off ]
A10: Send Intent [ Action:android.intent.action.SEND Cat:Default
Mime Type:audio/*
Data:
Extra:VoiceDir/%mostrecentfile
Extra:
Package:
Class:
Target:Activity ]
But the value %mostrecentfile returns the value 'VoiceDir' which is the folder name rather than the actual file so nothing is added with the sharing function.... help please?
Thanks in advance.
..so i found another way to show the most recent file in value using 2 simple actions on a task:
Recentfile (207)
A1: List Files [ Dir:VoiceDir Match: Include Hidden Files:Off Variable:%Recentfile ]
A2: Array Process [ Variable:%Recentfile Type:Reverse ]
Thanks to the 'array proccess, reverse' action, the value %Recentfile1 is always the newest file but keep in mind its because they are alphabeticaly ordered thanks to the dynamic naming sequence i gave to them when they are created which is:
%DATE-%TIME-%TIMES.wav
So %Recentfile1 returns:
/storage/emulated/0/VoiceDir/2-1-2014-01.27-1391246872.wav
Now im trying to share it using the EXTRA.STREAM intent but it does not attach anything :/
Sharefile (201)
A1: Send Intent [ Action:android.intent.action.SEND Cat:Default
Mime Type:audio/*
Data: Extra:android.intent.extra.STREAM ,%lastfile1
Extra:
Package:
Class:
Target:Activity ]
I got the share intent working for plain text before but cant get it to work with file attachments; i know im just inputing a field incorrecrly but which one?
Please help.
android.intent.extra.STREAM:%lastfile1
Matt
I put in the 'Extra' field:
android.intent.extra.STREAM: file:///mnt/sdcard/VoiceDir/filename
android.intent.extra.STREAM: /sdcard/Download/logo.png
android.intent.extra.STREAM: %lastfile1
android.intent.extra.STREAM: file:///%lastfile1
And a few more... tried with AND without the space after 'STREAM:'
I'm looking everywhere online for share intents but they are written differently when using actual coding.
This is from google'a tuturials for sharing a file maybe it will help:
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, uriToImage);
shareIntent.setType("image/jpeg");
startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.send_to)));
Is this really THAT complicated? :/
Please help thanks!
A1: Send Intent [ Action:android.intent.action.SEND Cat:None Mime Type:image/jpeg Data: Extra:android.intent.extra.STREAM:file:///sdcard/DCIM/Camera/1387752731265.jpg Extra: Package: Class: Target:Activity ]
Matt
Using Android 4.2.
Sharefile (201)
A1: Send Intent [ Action:android.intent.action.SEND
Cat:None
Mime Type:image/jpeg
Data:
Extra:android.intent.extra.STREAM:file:///sdcard/Download/logo.jpg
Extra:
Package:
Class:
Target:Activity ]
What am i missing here?
Any ideas?
Matt
Is there another way to implant a file share task/action?
Matt
am start -a android.intent.action.SEND -t image/jpeg --eu android.intent.extra.STREAM file:///sdcard/DCIM/Camera/1391914473967.jpg --grant-read-uri-permission
Matt
..but can i add the permission when i export the app and keep using the 'send intent' action?
Looks like this is what was missing all this time...hmmm how do you write the permission for 'reading uri' when you export as an app?