No, but you could do it Objective-C, which is what Myriad Helpers does. As Stefan says, you can also use beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:, as long as you don’t need to run under 10.6.
You should also go to bugreport.apple.com and lodge a request for a way to call methods that use blocks from ASObjC.
its beginSheetModalForWindow:homeWindow modalDelegate:me didEndSelector:"setUpWork:buttonReturned:contextInfo:" contextInfo:(missing value)
But as soon as I click on any button of the alert, the application crashes, reporting an EXC_BAD_ACCESS error.
Before I used only “setUpWork:” as selector and worked, but since I noticed that the “Cancel” button worked the same way as the “Continue” button, I changed the selector.
The method called is this
on setUpWork:alert buttonReturned:button contextInfo:info
--something
end setUpWork:buttonReturned:contextInfo:
Have you tried it in 10.10? It looks to me like it’s broken from ASObjC (again).
It still works in Objective-C, which means Myriad Helpers will still work. I guess sooner or later I need to look at changing it to beginSheetModalForWindow:completionHandler:, but that’s only 10.9 and above.