Ok, I admit I’m a total newb. But I can’t imagine this being that hard.
Quick background: Part of my job requires me to occasionally download and sequence screenshots from user’s PC’s. The files are stored on a server with a webpage style layout with a image having a sequential name (like 200723090001.jpg, 200723090002.jpg, etc).
I have a series of scripts that I run in Terminal that allow me to give the URL of the folder I want images from, and then give it a start number and an end number, then I redirect it to an HTML file. This is then saved as a Web Archive, which I then run through File Juicer to isolate the imges out. I then run another script that renames them based on the criteria I provide.
I don’t expect it all to be one click, but I would like a little less typing as I currently type out the entire command in Terminal by hand, for example:
The HTML part simply made for an easy way to get the image to File Juicer. Sometimes I just have to do a few images, but sometimes its a hundred images. When its high in image count, its much faster to load the HTML, save as archive, then juice it than it is to right click, save as.
I admit I have no idea what curl is, but what you decribe is pretty much correct. I shouldn’t need more than path, start and end range, and also a destination input. That’s all I can think of it needing anyway.
set imageFolderPath to text returned of (display dialog "Please enter the image folder path" default answer "")
set imageName to text returned of (display dialog "Please enter the image name" default answer "")
set startRange to text returned of (display dialog "Please enter the image start range" default answer "")
set endRange to text returned of (display dialog "Please enter the image end range" default answer "")
set shellCommand to "curl " & imageFolderPath & imageName & "[" & startRange & "-" & endRange & "].jpg -o ~/Desktop/\"" & imageName & "#1.jpg\""
do shell script shellCommand
Okay so for testing purposes I have 10 images online
It knows to chop of the last 4 characters plus how ever many digits myrange is. For example, as it is now I have three scripts: sequence2, sequence3 and sequence4, which correspond to how many digits I need it to modify. I don’t mind running them each serpeate as I am now, but I owuld think it could simply match what range I feed it. so if I say the range is 10-28, it’s a 2 digit sequence. If I put in 89-107, its a three digit sequence, etc. I can put in leading zeros if needed, I don’t mind.
Lastly, I need to specify the output folder. Although everything goes into ~\Pictures\Captures and then I would make a folder specific to the request number, then a subfolder of the computer name that generated the captures. So a completed destination path would be something like:
curl (or cURL) is a command line tool for transferring files with URL syntax
So how about this what are some specific examples of info you would like to feed into the system (in an ideal world) and what you would expect to happen at that point. ie… so I can see what you would be entering to come up with that specified output path… and I didn’t follow wether leading zeroes did or did not exist