Repeat-Handler-Cancel
Repeat-Handler-Cancel
- Subject: Repeat-Handler-Cancel
- From: Brad Giesbrecht <email@hidden>
- Date: Sun, 18 Mar 2001 11:34:37 -0800
Hi list,
I am struggling with this problem.
I have some repeats that call some handlers.
In these handlers I have some dialogs.
When I click cancel in these dialogs, my repeat continues.
I had this problem solved by setting some variable but
I was trying to clean up my code and I figured there was
a better way to do this.
<snip>
on processItems(theseItems)
try
tell application "Extensis Portfolio 5.0.1" to activate
repeat with i from 1 to count of theseItems
if limit is true then pauseDialog()
end repeat
on error m number n
set h to "processItems" as string
errorDialog(h, m, n)
end try
end processItems
on pauseDialog()
try
set setOpt to the button returned of (display dialog "Stuff"
{"Cancel", "Options", "Continue"} default button "Continue" with icon 1)
on error m number n
set h to "pauseDialog" as string
if n = -1712 then --If I timeout, reinitiate me.
pauseDialog()
else if n -128 then
errorDialog(h, m, n)
end if
end try
set limit to false as boolean
end pauseDialog
on errorDialog(h, m, n)
display dialog h & return & m & return & n
end errorDialog
<end snip>
Thanks,
Bradley Giesbrecht