I’ve followed the tutorial in Applescript ObjC Explored (thank you, Shane, it’s awesome!) and built myself a table of objects with Add and Remove buttons – both bound to the respective methods in the array handler.
What I would like to do is make the remove just a little bit smarter:
First, setDocumentEdited on the main window (I use the window state since the app manages a text file).
Second, make it possible to undo the delete and add the object back into the array with a CMD+Z.
Because the button is linked to the array’s remove method, I can’t add additional functions. Also, I’m generally confused on how to handle undos in general within AppleScript ObjC.
If any of you have some tips on this, I’d really appreciate it. Code examples would be especially useful – I’m still learning my way around converting more complex Cocoa methods into AppleScript format.