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

Dick Kriesel dick.kriesel at mail.com
Wed May 2 14:36:45 EDT 2012


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