XCode Menu Script / AppleScript questions
XCode Menu Script / AppleScript questions
- Subject: XCode Menu Script / AppleScript questions
- From: David Hoerl <email@hidden>
- Date: Thu, 1 Feb 2007 13:56:37 -0500
Xcode provides many variables for use by scripts, including the
ability to get the current selection, but also some that expand to
the location of the selection:
%%%{PBXSelectionStart}%%% is replaced by the index of the first
character in the selection in the active text object.
%%%{PBXSelectionEnd}%%% is replaced by the index of the first
character after the selection in the active text object.
%%%{PBXSelectionLength}%%% is replaced by the number of characters in
the current selection in the active text object.
Using the existing script API, it would seem these are only of
interest if you use the variable that expands to the complete text
file.
Question 1: of what use are the above variables? [Their existence
makes me think I'm missing something on the API, thus the question.]
Switch to trying to drive Xcode with AppleScript:
Open a Xcode project, All-In-One window style.
I try to "walk" the Xcode dictionary to see what information I can
retrieve. I started with the Xcode Application Suite, and started
with a couple of simple requests: "get active project document" and
"get window 1".
You can get a record filled with information about either by asking:
get properties of active project document or get properties of window 1
However, this is where things start going awry. For instance, the
dictionary says windows have a document, but both the returned
properties and direct queries such as "get document of window 1" show
document as "missing value".
The properties of a text window include an "associated text document"
but this term is not in the dictionary (so no apparent way to use it
directly) - it's a file path.
Question 2: is it possible to get at the open text file, to get its
insertion point offsets, change its insertion point, and/or to
get/set arbitrary chunks of text?
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden