Help with AppleScript – how to stop repeat
In order to generate missing previews (which Capture One doesn't always do automatically), I tried using this script to make Capture One go through all images in a catalogue:
tell application "Capture One" to activate
tell application "System Events"
repeat
key code 124
delay 0.4
end repeat
end tell
And it works, except once it's started it doesn't stop.
Any suggestions how to add an option to stop the script again?
-
You need something you are repeating until. I use "repeat until" some system event condition. You need to know how to detect what you are waiting for to be finished or true or what ever the condition. For example if you are filling in a field with a value then you need to have code in your look that inspects that field to see if it now has the value you expect. You repeat until it has that value.
0 -
Thanks.
Do you know if it's possible to specify a number of repeats?
0 -
Oh, I found it. That was simple:
repeat 4 times
0 -
Glad that worked.
0
Post is closed for comments.
Comments
4 comments