Re: Insert text into a document (beginners Question)
Re: Insert text into a document (beginners Question)
- Subject: Re: Insert text into a document (beginners Question)
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 12 Dec 2003 14:42:39 -0800
On 12/12/03 2:22 PM, "Walter Ian Kaye" <email@hidden> wrote:
>
>
> This is what should work:
>
>
>
> tell application "Xcode"
>
> tell text document 1
>
> set theSelection to selection
>
> set {a, b} to character range of theSelection
>
> set character range of theSelection to {b, b}
>
> set contents of theSelection to "Insert another sentence here. "
>
> end tell
>
> end tell
>
>
>
> But it errors on getting the 'character range'. That appears to be a bug,
>
> especially since the result of 'selection' is:
>
>
>
> --> characters 19 thru 42 of document "Untitled" of application "Xcode"
>
>
>
> If anyone knows another way parse that '19' and '42', it should be possible
>
> to set insertion point of the text, if not character range.
>
>
Can you use 'after' and/or 'end of' selection?
No, nothing seems to work.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.