Post

Replies

Boosts

Views

Activity

How to make a progress meter for an AppleScript that works with the Photos app
I wrote an AppleScript that takes a bunch of scanned jpegs with systematically named filenames and transfers information from the filename into the date and time fields. That all works fine, but I've got many more scans to do and I'd like to augment the script to include a progress meter because it takes a long time to run on e.g. 1000 photos. I've found basic progress meter examples online that involves commands like: set progress total steps to theImageCount set progress completed steps to 0 set progress description to "Processing Images..." set progress additional description to "Preparing to process." and they run OK in a separate dummy test case, however I'm getting syntax errors for such commands in my renaming script because (I think) they're inside a tell application "Photos" wrapper and it looks like Photos doesn't like those commands. A progress meter (in any AppleScript) should be a straightforward thing i.e. I can clearly define a total number of steps and I can clearly define the step number I'm currently on. I just want to display something like: I'd even be OK with just implementing something like: display dialog "blah blah" but that needs to be manually dismissed with each iteration of the loop, so that's no good. I also tried: display notification "blah blah" but that yields hundreds of notification boxes at the top right of my screen, so that's also impractical. I was even thinking maybe I could call some generic system progress meter with all the right variables via a "do shell script" command (although I have no idea how to do that). Something surely must be possible, but I just can't figure it out :-(. Could some kind soul please help me out. Thanks.
9
0
347
Mar ’25