So I am trying to implement a progress bar in a script I am using to process several thousand files. I have found examples of code such as the majority of the code below that demonstrate how to use it. I have added a tell block to indicate where I would add AppleScript to operate on photos. The problem is that Photos does not know about progress so I can not update the completed steps.
I could remove the tell block as it sits now and replace it with several tell blocks. It might be a bit painful and it seems to me to make more sense to use something like a tell block that applies to the set progress statement. I have just been unable to figure out what I need to provide to AppleScript to get it to understand. I just have not found it in the “documentation”. So I am hoping that folks here might be knowledgeable enough to point me in the right direction.
Thanks,
Chip T
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
on run
-- your code goes here...
set n to 2028
set progress total steps to n
set progress description to "Script Progress"
set progress additional description to "This should be helpful"
tell application "Photos"
-- This is where I would operate on photos
repeat with i from 1 to n
delay 1
set progress completed steps to i
end repeat
end tell
end run