I only need the file name, not the full path

Get the app to show me the path of the MP3 file on my mobile.
But I only need the "name.mp3". Can someone help me solve it?

Thank you so much.

what is the name in this case? 0001.mp3?
if yes, use the split block from the text drawer to split at %20 and use the select list item block to select the last item from the list

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Thanks for the help. The file name is "FX - 001"

in which case split at %2F and get the last element from the resultant list

You will then need to tidy up the %20s - I suggest you replace these with underscores....

1 Like

Hi @fabiogmar
Above mentioned way will work in most cases but if that does not work then you can try this:

  • convert content uri to file path
  • split path at / and select last item of list
2 Likes

Thank you very much for commenting.
The truth is that I have been giving my head against the monitor for days. I can't do it. Could you send me an image of the code?
I need it to look like this ...


Greetings.

Sorry, I can't post blocks at this time but I can tell you the method.
There are two file manager extensions available which are following:
TaifunFile by @Taifun
FileTools by me

Both extensions offer method to convert content uri into file path.

2 Likes

I used FileTools extension as Sunny has been helping:

2 Likes

and just using built in blocks

1 Like

Its help works very well, but if I change the audio of that button, it no longer updates to the new name, it keeps the old one. Maybe my project is not well built. Thank you very much for your help.

Kindly show your blocks.

1 Like

Thanks for your interest.
Here I pass the blocks.
The purpose of this application is for each person to load the audio from their cell phones and change them whenever they want.
Greetings and thanks again.

1 Like

Text does not change because AfterActivity you are decoding same content uri.
Simply replace it with ResultUri.

2 Likes

closing....now asking the same thing on Kodular

1 Like