Intercepting 'set the script..." in the IDE editor

Dar Scott dsc at
Thu May 3 17:08:07 EDT 2012

Hi, Dick!

That looks very promising.  I will try it.

I hope I do not have too many questions.

Why does the focusedObject have to be "Script"?  It seems there might be scenarios where the user clicks the Apply button and the field does not have the focus.

Does this bring up the dialog about the script changed outside of the editor?  I guess I can tinker with it to find out that.


On May 2, 2012, at 12:36 PM, Dick Kriesel wrote:

> On May 2, 2012, at 9:02 AM, Dar Scott wrote:
>> I want to make a plugin that makes some tweaks to a script just before it is applied.
> On Feb 4, 2012, at 12:47 PM, Dick Kriesel wrote:
>> When I needed to do that, I read through the IDE scripts to choose a message the IDE fires late in the "apply" process, so I could trap it in a frontScript.  Eventually I chose to trap seUpdateCheckSum.
>> Do something like this in your frontScript:
>> -- <script>
>> command seUpdateCheckSum pObject, @pScript -- note:  a post-compile message
>>  local tField, tPendingMessages
>>  if there is a pObject then
>>     put the focusedObject into tField
>>     if the short name of tField is "Script" then
>>        put the pendingMessages into tPendingMessages
>>        filter tPendingMessages with "*,myApplyAction," & long id of the target
>>        if tPendingMessages is empty then
>>           send "myApplyAction pObject, pScript, tField" to the target in 0
>>        end if
>>     end if
>>  end if
>>  pass seUpdateCheckSum
>> end seUpdateCheckSum
>> command myApplyAction pObject, pScript, pField
>>  -- do my stuff here
>> end myApplyAction
>> -- </script>
>> Does that work for you?  Any questions?
>> -- Dick

More information about the use-livecode mailing list