Auto update file path (taking picture)

nginx27

New member
So I'm making a macro that takes picture using front cam every time someone unlocks my phone. Don't ask why. LoL

I want to separate all the pictures each day. I know how to make a folder with current date but I don't know how to automatically use that folder as a save file path of images. I think this problem is caused by android limiting the permission of the app but you guys think theres a way around?
 

Dimlos

Well-known member
Create a FrontCamera folder in DCIM and change the settings to save the photos in that folder.
If the macro works, the photos will be saved once in the FrontCamera folder and then moved to a folder created for the year and date.
 

Attachments

  • Photo_File_Path.macro
    3 KB · Views: 14

nginx27

New member
Create a FrontCamera folder in DCIM and change the settings to save the photos in that folder.
If the macro works, the photos will be saved once in the FrontCamera folder and then moved to a folder created for the year and date.
Works great. Thank you.
 

nginx27

New member
Create a FrontCamera folder in DCIM and change the settings to save the photos in that folder.
If the macro works, the photos will be saved once in the FrontCamera folder and then moved to a folder created for the year and date.
Hey. Need your help again. I'm not familiar with shell scripts so I search how to use zip command but I keep getting errors...

suppose I have a folder containing all the jpg located in storage/emulated/0/front/october1

I wrote

zip -r october.zip storage/emulated/0/front/october1

But I get this output error
/system/bin/sh: <stdin>[52]: zip: inaccessible or not found

not sure what's the problem. Can you educate me?
 

Dimlos

Well-known member
I'm no shell scripting expert either, but I'll do some research.
Is there more than one folder in october1 and should I just zip them all together?
 

nginx27

New member
I'm no shell scripting expert either, but I'll do some research.
Is there more than one folder in october1 and should I just zip them all together?
Nah. Just pure jpgs.
I just want to archive all the images so no image viewer app can see the images. Most apps nowadays can see folder with a dot (.) name and/or with .nomedia file inside.
Archiving makes managing files more convenient.
Thanks man.
 

Dimlos

Well-known member
The shell scripts could not be used because the zip command was omitted from the shell scripts.
I was able to zip compress the files using Termux, but setting up Termux and Termux:Tasker is a bit difficult if you are not familiar with it.
I can upload macros and scripts if you can set them up yourself, as it is impossible to explain the setup from scratch here.
 

Dimlos

Well-known member
I'll upload the macro in case some of you are interested, provided that you have installed Termux and Termux:Tasker from F-Droid, set them up, and done termux-setup-storage.

The storage location of the images is storage/emulated/0/DCIM/front/october1 because Termux is limited in the directories it can access.

The folder name under front and the name of the compressed file can be specified in the user variable of the macro.

The macro calls zip.sh from Termux:Tasker, the source of zip.sh is here.
Bash:
#!/bin/bash
zip -m -j ~/storage/dcim/front/$1/$2.zip ~/storage/dcim/front/$1/*.jpg
 

Attachments

  • Zip_Archive.macro
    5.7 KB · Views: 2

Jacob L

Moderator (Lawsonator)
Hey. Need your help again. I'm not familiar with shell scripts so I search how to use zip command but I keep getting errors...

suppose I have a folder containing all the jpg located in storage/emulated/0/front/october1

I wrote

zip -r october.zip storage/emulated/0/front/october1

But I get this output error
/system/bin/sh: <stdin>[52]: zip: inaccessible or not found

not sure what's the problem. Can you educate me?
Try this: https://www.macrodroidlink.com/macrostore?id=6072
 

Dimlos

Well-known member
tar and gz can create compressed files with shell scripts, but unlike the zip option used in Termux, they are not very useful because they create a lot of useless folders.
 

Dimlos

Well-known member
I am not answering effortlessly either, I am posting through trial and error, I hope we can both improve our knowledge.
 
Top