local dlg, okHook = ... -- These are the methods available from the ProposeSpinDialog: print( dlg:getShift() ) print( dlg:getAtomType() ) print( dlg:getIsotope() ) print( dlg:getSpectrum() ) print( dlg:getProject() ) print( dlg:getAnchor(1) ); print( dlg:getAnchor(2) ); print( dlg:getAnchor(3) ); if okHook then -- The OK button was pressed: print( "Spin "..dlg:getSpin():getId().." selected" ); else -- The dialog is shown. Fill the list of available spins with our own set: dlg:enableOkHook(); -- We want to be informed if the user presses "OK" -- if you don't call enableOkHook, then this script is only run once, when the -- dialog is shown -- The following code simulates the default behaviour of CARA: local spins = dlg:findMatchingSpins() for a,b in pairs( spins ) do dlg:addSpin( b.spin, b.fit ) end end