If I select every occurrence of "whatsit" through which ever means.
Work file: def do_something( doohickeis ) doohickeis.each do | whatsit | whatsit.this! whatsit.that! print whatsit end end Then run this AppleScript. AppleScript: tell window 1 of application "BBEdit" set stuff to get selection end tell It returns a list like this. List: {characters 54 thru 60 of text document 1, characters 66 thru 72 of text document 1, characters 82 thru 88 of text document 1, characters 104 thru 110 of text document 1} Thats great, but if I use that list to select those items again like this. AppleScript: tell window 1 of application "BBEdit" set stuff to get selection select stuff end tell Each selection will shrink by one character, from the right end of the selection. So characters 54 thru 60 will look like 54 thru 59 as so on through the list. This list as reported by AppleScript will not change the first time, but will if you run the script multiple times. The selections will shrink on every consecutive run until they're gone. If I do the same thing with a contiguous selection (no lists involved just the range of characters) this doesn't happen. What's going on here? Thanks, — Chris(topher)? -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "supp...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/B14B9AE3-5C32-42ED-B952-4D222CE7BE98%40rustydogink.com.