• 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: selective string-replace
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: selective string-replace


  • Subject: Re: selective string-replace
  • From: Paul Skinner <email@hidden>
  • Date: Thu, 8 Aug 2002 09:01:29 -0400

On Wednesday, August 7, 2002, at 04:59 PM, Paul Skinner wrote:

set inputString to "http://progressive.stream.aol.com/newline/gl/newline/lordoftherings/TheTwoTowers_480.
mov
http://progressive.stream.aol.com/wbonline/reloaded_teaser_1_480.mov";

set AppleScript's text item delimiters to "//"
set inputString to text items of inputString
repeat with i from 1 to length of inputString
set AppleScript's text item delimiters to "/"
set item i of inputString to text items of item i of inputString
set AppleScript's text item delimiters to ""
set item i of inputString to (item i of inputString) as text
end repeat
set AppleScript's text item delimiters to "//"
set inputString to inputString as text

-->"http://progressive.stream.aol.comnewlineglnewlinelordoftheringsTheTwoTowers_480.
mov
http://progressive.stream.aol.comwbonlinereloaded_teaser_1_480.mov";


Obviously that should have been...

set inputString to "http://progressive.stream.aol.com/newline/gl/newline/lordoftherings/TheTwoTowers_480.
mov
http://progressive.stream.aol.com/wbonline/reloaded_teaser_1_480.mov";

set AppleScript's text item delimiters to "//"
set inputString to text items of inputString
repeat with i from 1 to length of inputString
set AppleScript's text item delimiters to "/"
set item i of inputString to text items of item i of inputString
set AppleScript's text item delimiters to "|"
set item i of inputString to (item i of inputString) as text
end repeat
set AppleScript's text item delimiters to "//"
set inputString to inputString as text

-->"http://progressive.stream.aol.com|newline|gl|newline|lordoftherings|TheTwoTowers_480.
mov
http://progressive.stream.aol.com|wbonline|reloaded_teaser_1_480.mov"

--
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: selective string-replace (From: Paul Skinner <email@hidden>)

  • Prev by Date: Re: Scripting EIMS over a LAN
  • Next by Date: Re: Newbie, every word where it contains "ox"
  • Previous by thread: Re: selective string-replace
  • Next by thread: Re: selective string-replace
  • Index(es):
    • Date
    • Thread