zobnin / aiolauncher_scripts

Scripts for the AIO Launcher
https://aiolauncher.app
86 stars 20 forks source link

Open a file in a script #21

Closed tjthejuggler closed 1 year ago

tjthejuggler commented 1 year ago

Up until today I had a custom widget that would show what was in a file located at /storage/emulated/0/Documents/myfile.md however now with custom widgets removed I'm trying to do this with Lua scripting. I have gotten files:read("myfile.md","r") to work, but it needs the file to be deep inside android/data/ru.. and I need to be able to read files that are not all the way in there. I've tried doing io.open , but it seems like aio doesn't have access to external files or something. Is it now impossible to have a widget show what is in one of my files? Thanks so much!

zobnin commented 1 year ago

Yes. Modern android versions restricts access to storage. As workaround you can connect script with tasker profile that reads your file. See "Tasker" section in the README.

tjthejuggler commented 1 year ago

Ah! Tasker, I should have known. Thanks so much for the info, the fast reply, working on such an awesome launcher, everything! I really appreciate it.

zobnin commented 1 year ago

Thank you