• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Insert text into a document (beginners Question)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Insert text into a document (beginners Question) (From: Walter Ian Kaye <email@hidden>)

  • Prev by Date: New AppleScript book
  • Next by Date: Re: Reading a file as it fills up by another program
  • Previous by thread: Re: Insert text into a document (beginners Question)
  • Next by thread: AppleScript, Panther, and Internet Connect
  • Index(es):
    • Date
    • Thread