Open a file in a script #21

Closed
opened 2023-07-07 12:00:57 -04:00 by tjthejuggler · 3 comments
tjthejuggler commented 2023-07-07 12:00:57 -04:00 (Migrated from github.com)

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!

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 2023-07-07 12:14:29 -04:00 (Migrated from github.com)

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.

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 2023-07-07 13:12:18 -04:00 (Migrated from github.com)

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.

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 2023-07-07 13:14:17 -04:00 (Migrated from github.com)

Thank you

Thank you
Sign in to join this conversation.
No description provided.