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: Shane Stanley <email@hidden>
- Date: Sun, 30 Dec 2001 18:51:29 +1100
On 12/29/01 12:33 PM, "Jason Bourque" <email@hidden> wrote:
>
Hello,
>
>
This is what I have but it doen't work.
>
>
I want to select contents of a handler by name.
>
>
>
>
Any ideas.
>
>
tell application "Script Debugger"
>
tell document 2
>
set selection to text of contents of script handler "Handler2Test"
>
end tell
>
End tell
>
How about this:
set handlerName to "testHandler"
tell application "Script Debugger"
tell document 2
set x to contents
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"on " & handlerName & "("}
set theOffset to length of text item 1 of x
set AppleScript's text item delimiters to oldDelims
select character (theOffset + 1)
balance
end tell
end tell
--
Shane Stanley, email@hidden