Tuesday, October 27, 2020

#1 2011-06-07 07:23:30 am

Registered: 2011-06-07
Posts: 1

Receive a Selection's Location

Hi all,

I am new to this forum and hope that anyone of you could provide me a hint. I tried to use the search function as well as google but I cannot find a solution for my problem.

The problem is:
I would like to receive the information about the location of a selection in a text document in Xcode. All I can easily get is the selection's contents via:


set a to contents of selection of the text document 1

However, I need to get the start/end line and the start character and end character/length of selection. I can see in the results of


set a to selection of the text document 1

something similar to for example

text 285 thru 294 of text document "FILENAME" of application "Xcode"

How do I get the numbers? Xcode's dictionary states the type of selection is "tsel". Unfortunatelly, I cannot find any further information on it, especially on its properties.

Best regards,

(AppleScript 2.0.1, Xcode 3.1.4, Mac OS 10.5)

Filed under: xcode, selection, location



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)