On 11/25/09 at 3:20 PM, [email protected] (Christopher 
Stone) wrote:

>Am I missing something, or is this really the simplest way to 
>get and  then delete the last line?

It's not the simplest way, but in BBEdit, a "line" refers to a 
text object containing zero or more characters, ending with a 
line break (or end-of-document). So if the document ends in a 
carriage return (i.e. a blank line), the last line will be empty 
and deleting it will have no visible effect. In that case, what 
you need to do is inspect and delete the line _before_ the last line:

     tell application "BBEdit"
         tell front text document
             tell line before last line
                 set theURL to its contents
                 delete its text
             end tell
         end tell
     end tell

R.
-- 
Rich Siegel                                 Bare Bones Software, Inc.
<[email protected]>                      <http://www.barebones.com/>

Someday I'll look back on all this and laugh... until they 
sedate me.

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.

Reply via email to