In my old xcode applescript application I use a lot of else if’s inside the on clicked handler, how would I do the same in ASObjc?
on clicked theObject
if name of theObject is "A" then
beep 1
else if name of theObject is "B" then
beep 2
else if name of theObject is "C" then
beep 3
end clicked
on connectThisInInterfaceBuilder_(sender)
if name of theObject is "A" then
beep 1
else if name of theObject is "B" then
beep 2
else if name of theObject is "C" then
beep 3
end
end connectThisInInterfaceBuilder_
The best answer is probably that you wouldn’t. Instead of the ASStudio way of one handler for all clicks, in ASObjC you’re more likely to make separate handlers for each button (unless they do the same thing).