Re: Script Debugger: select contents of a handler by name
Re: Script Debugger: select contents of a handler by name
- Subject: Re: Script Debugger: select contents of a handler by name
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 29 Dec 2001 15:59:49 -0800
On 12/29/01 3:28 PM, I wrote:
>
I found a workaround, when I discovered that
>
>
set selection to <<script handler "Handler2Test">>
To work on an actual script in the front when you double-click a handler
name anywhere in the script, I'd suggest that in place of the first two
lines, you use something like this:
set theScript to document 1
try
set theSelection to selection of theScript
set handlernames to name of every script handler of theScript
repeat with i from 1 to (count handlernames)
set handlerName to item i of handlernames
if handlerName = theSelection then exit repeat -- defined with
correct lower-case spelling for script handler
end repeat
if handlerName theSelection then error number -128
on error
beep 2
display dialog "No handler name was selected." buttons {"OK"}
default button 1 with icon 0
return
end try
--
Paul Berkowitz