• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Script Debugger: select contents of a handler by name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Script Debugger: select contents of a handler by name
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: Script Debugger: select contents of a handler by name (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Bug in Display Dialog
  • Next by Date: Re: Script Debugger: select contents of a handler by name
  • Previous by thread: Re: Script Debugger: select contents of a handler by name
  • Next by thread: Re: Script Debugger: select contents of a handler by name
  • Index(es):
    • Date
    • Thread