2 Replies Latest reply: Mar 30, 2011 7:35 AM by cthibos
cthibos Level 1 (0 points)
Hi guys,

I am having a simple problem making applescript choose which line from a textwrangler document to copy. It's very simple, all I want it to do is the following.

1)Check to see if line 22 is just a carriage return
2) If it is, copy line 13 to the clipboard
3) If it's not, copy line 22 to the clipboard

My current code is this:

tell application "TextWrangler"
     if contents of line 22 of window 1 is "\r" then <--this is really two backslashes before the r
               copy line 13 of window 1
               copy line 22 of window 1
     end if
end tell

Any help would be appreciated.



MacBookPro, Mac OS X (10.6.7)