Code: Select all
on deleteCard
if the cantDelete of this card is "true" then
answer "You must unlock the padlock icon before you can delete this card."
else
pass deleteCard
end if
end deleteCard
I tried checking the icon ID of the padlock button instead of the cantdelete property of the card, but that didn't work, either. I also tried On doMenu...
I see from the docs that I can't trap the deleteCard message. And, in fact, the deleteCard message doesn't seem to appear in the message watcher. So it's not surprising that the script doesn't work.
The way it works now, if the cantdelete of the card is set to true and I choose "Delete Card" from the "Object" menu, I get the "are you sure you want to delete this card?" message, but nothing happens when I choose "Yes." The on deleteCard script seems to be ignored entirely.
I suppose one approach would be to set the cantdelete of all cards to true, forget about using the Delete Card menu item, and to make a "delete card" button instead. But maybe there's a better way.
Thanks,
Tim