• 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: changing part of a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing part of a string


  • Subject: Re: changing part of a string
  • From: Luther Fuller <email@hidden>
  • Date: Mon, 28 Jan 2008 07:46:43 -0600

I am currently re-writing a script that uses both of these techniques. They work.

On Jan 28, 2008, at 7:33 AM, Mark J. Reed wrote:
Huh. For some reason i had it in my head that AS strings were immutable.

On 1/28/08, Luther Fuller <email@hidden> wrote:
On Jan 27, 2008, at 7:02 PM, Patrik B. wrote:
I have a path that I need to change slightly:
Example:
G5:bigfolder:2 color:myfolder:image1.eps  -- I need to change "2
color" only
G5:bigfolder:CMYK images:myfolder:image1.eps
How do I replace out just "2color" to "CMYK color" is it possible
to search

If you know, without searching, that you want to change text item 3, then ...

set fullPath to "G5:bigfolder:2 color:myfolder:image1.eps"
set AppleScript's text item delimiters to {":"}
set text item 3 of fullPath to "CMYK images"

If you need to search for and test the text item, you might want to ...

set AppleScript's text item delimiters to {":"}
then get a list of path items;
determine which item to change;
change it;
convert list of path items back to a full path.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: changing part of a string
      • From: "Mark J. Reed" <email@hidden>
References: 
 >changing part of a string (From: "Patrik B." <email@hidden>)
 >Re: changing part of a string (From: Luther Fuller <email@hidden>)
 >Re: changing part of a string (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: changing part of a string
  • Next by Date: Re: changing part of a string
  • Previous by thread: Re: changing part of a string
  • Next by thread: Re: changing part of a string
  • Index(es):
    • Date
    • Thread