Select Lines

9 views
Skip to first unread message

Christopher Stone

unread,
Mar 2, 2011, 3:24:05 PM3/2/11
to bbe...@googlegroups.com
Hey Folks,

In the first script 'topAnchor' and 'bottomAnchor' produce objects of class 'line'. It seems though that one cannot use that as a reference for selection.

tell application "BBEdit"
tell text of front text window
set topAnchor to first line whose contents is not ""
set bottomAnchor to last line whose contents is not ""

# THIS FAILS
if topAnchor ≠ bottomAnchor then
select (topAnchor thru bottomAnchor)
end if

end tell
end tell

To make it work I have to do something like this:

tell application "BBEdit"
tell text of front text window
set topAnchor to startLine of (first line whose contents is not "")
set bottomAnchor to startLine of (last line whose contents is not "")
select (lines topAnchor thru bottomAnchor)
end tell
end tell

This is not a major problem; I just want to make certain I'm not missing an easier method.

TIA

--
Best Regards,
Chris

Reply all
Reply to author
Forward
0 new messages