Execute script after cloning an object ?
Posted: Thu May 31, 2018 12:31 am
I'm building an application that lets the user clone objects in "pointer mode" using the (opt-click-drag). I would like to add the ID of the newly created object to a datagrid. I'm checking to see if the option key is down and adding the ID to the datagrid but it adds the ID of the original button... The script below is in the original button. I'm pretty sure I'm going about this the wrong way
Is there another way to trap the opt-click-drag message ?

Code: Select all
on checkOptionKey
if the eventOptionKey is down then
select last button
put the dgNumberOfLines of group "Datagrid" into theLineNo
put the dgDataOfLine[theLineNo] of group "Datagrid" into theDataA
put the id of selectedObject into theDataA["ID"]
dispatch "AddData" to group "Datagrid" with theDataA, theLineNo +1
end if
end checkOptionKey