• 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: BBEdit 5 & selection-object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BBEdit 5 & selection-object


  • Subject: Re: BBEdit 5 & selection-object
  • From: Ricardo Montiel <email@hidden>
  • Date: Fri, 23 Feb 2001 16:32:12 -0300

on 22 Feb 2001 23:20, email@hidden wrote:

> I had trouble with that one too, I think it's just confusing
> documentation. I believe object is there as a descriptor not code. I
> found these to work, although I lay no claim to their correctness :-)
>
> on run
> tell application "BBEdit 5.1"
>
> set ln to (the number of lines of window 1)
> set stln to startLine of selection as integer
> set edln to endLine of selection as integer
>
> set s31 to the offset of character 1 of line stln
> set s32 to the offset of selection as integer
>
>
> set e31 to the offset of character 1 of line edln
> set e33 to the length of selection as integer
>
> -- you can manipulate these numbers and then reselect text eg.
> select characters s31 through e32 of line stln
>
> end tell
> end run
>
>> Hallo,
>>
>> I wrote this:
>>
>> set x to line of selection-object
>>
>> After compile I get this:
>>
>> set x to (line of selection) - object
>>
>> What is wrong?
>>
>> Iam using BBEdit 5.0 and Script Debugger 1.0.4.
>>
>> Thank you
>>
>> Daniel Komrska jr.


Hi,

This works in BBEdit 5.1 to "record" a selected chunk of characters (for
example, as the result of a find task or as the result of a manual
selection; why bother with line numbers?), but it's not functional in v6.x:

set xSelStart to selection start
set xSelEnd to selection end


Do your stuff and then, when you need to reselect the text, use:

select (characters xSelStart thru xSelEnd)


HTH,

Saludos,
-- Ricardo


  • Prev by Date: Digest default subjects (was Re: applescript-users digest,> Vol 2 #406 - 2 msgs)
  • Next by Date: Re: Digest default subjects (was Re: applescript-users digest,> Vol 2 #406 - 2 msgs)
  • Previous by thread: Re: BBEdit 5 & selection-object
  • Next by thread: Re: BBEdit 5 & selection-object
  • Index(es):
    • Date
    • Thread