• 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: 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


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

  • Prev by Date: Re: Panorama and AppleScript
  • Next by Date: Source Text of Script Objects
  • 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