• 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: Today's Question - poke a character in a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Today's Question - poke a character in a string


  • Subject: Re: Today's Question - poke a character in a string
  • From: Paul Skinner <email@hidden>
  • Date: Wed, 31 Jul 2002 10:25:18 -0400

On Wednesday, July 31, 2002, at 05:38 AM, Andy Wylie wrote:
on 7/31/02 7:36 PM +1200: email@hidden wrote:

SNIP
Is there a way to tell AppleScript to

set character 400 of MyLongString to ">"

instead of going:

set MyLongString to (characters 1 thru (CurrentIndex-1) of MyLongString) &
">" & (characters (CurrentIndex+1) thru end of MyLongString) as string

set (MyLongString's text items)'s item 400 to ">"

____________________________ Andy

I'm pretty sure that you can't do this kind of in-place data manipulation of stings in AS. You'd have to...

set MyLongString to MyLongString's characters
set item 400 of MyLongString to ">"
set MyLongString to MyLongString as text

But this is susceptible to the 'Y4K' problem AKA: Stack Overflow.
--
Paul Skinner
_______________________________________________
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: Today's Question - poke a character in a string (From: Andy Wylie <email@hidden>)

  • Prev by Date: duplicate file with number
  • Next by Date: Re: scripting mail
  • Previous by thread: Re: Today's Question - poke a character in a string
  • Next by thread: Re: Today's Question - poke a character in a string
  • Index(es):
    • Date
    • Thread