I am using JXA (javascript for automation) on my Mac to try to automate iTunes Connect screenshot uploads. Because of this, I want to automate grabbing each image and uploading it, but for iTunes Connect to allow this (using iTMSTransporter), I need to edit a XML file and add in each image's size in bits, as well as get the checksum (type="md5").
I know I could do this manually, but I want to automate it as this will save me a lot of time in the long run, with tons of different screenshots for each localization.
I've used JXA to grab the images, and get their dimensions, but can't figure out getting the size & checksum. Maybe someone can help? Or if not using JXA, maybe there is some sort of other script that JXA can run (like a shell script, which I have no experience with what so ever as of now), or maybe some script I could just run ahead of time and export the XML to a file manually. From there I could use JXA to parse that file.
Here is what I have so far for what it takes to get the image file:
desktopPath = finder.desktop.url();
desktopPath = desktopPath.substring(7, desktopPath.length);
var imagePath = Application('System Events').folders.byName(desktopPath + '/myImage.png');
imageEvents = Application("Image Events");
imageEvents.launch();
imageEvents.name();
img = imageEvents.open(Path(imagePath));
// now I don't know what to do with the image as the documentation is quite difficult for me to understand