99% of the time this will get you what you need. The 1% question is if the name of the 
script is actually "Some Code" (with quotes around it). That, as opposed to the script 
name being Some Code (w/o quotes around it).

The code below will return different results:

-- "MouseDown = "
-- "MouseUp = "Some Code""

Thought I'd point that out just in case you are up against the 1% bug.

Regards,
Kraig


on getScriptName(me)
  
  tScriptName = string(me.script)
  tName = EMPTY
  repeat with tWord = 2 to tScriptName.word.count
    tName = tName && tScriptName.word[tWord]
  end repeat  
  tName = tName.char[3..(tName.char.count) - 2]
  return(tName)
  
end getScriptName 



on mouseUp(me)
  put "MouseUp = " & me.getscriptname()
end


on mouseDown(me)
  the itemdelimiter = quote
  put "MouseDown = " & item 2 of string(me)
end



> A self reference contains the info.
> For example, using a script member named "Some Code"
> 
> on new me
>    put me
> end
> -- <offspring "Some Code" 2 1e231b3c>
> 
> or
> 
> on new me
>   the itemdelimiter = quote
>   put item 2 of string(me)
> end
> -- "Some Code"
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to