• 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: Faulty text item delimiters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Faulty text item delimiters


  • Subject: Re: Faulty text item delimiters
  • From: david <email@hidden>
  • Date: Tue, 11 Oct 2005 02:50:42 -0400


On Oct 11, 2005, at 2:07 AM, Paul Berkowitz wrote:


The problem arose when he tried to run a script of mine that checks the
version of iCal and won't run if it's earlier than v2.0. I narrowed it down
to this bit:



set AppleScript's text item delimiters to {"."} tell application "iCal" to set icalVersion to version as string set txtItems to text items of icalVersion set AppleScript's text item delimiters to {""} set icalVersion to text 1 thru 3 of ((txtItems as string) & "0") {txtItems, icalVersion} --> {{"2", "0", "2"}, "202"}

But what he gets is :
-->  {{"2.0.2"}, "2.0"}


set AppleScript's text item delimiters to {"."}
tell application "iCal" to set icalVersion to version as string
set txtItems to text items of icalVersion
set AppleScript's text item delimiters to {""}
set icalVersion to text 1 thru 3 of ((txtItems as string) & "0")
{txtItems, icalVersion}

-->  {{"2", "0", "2"}, "202"}


look at the following text item delimiters:

set AppleScript's text item delimiters to {"/."} <----------------- "/."
tell application "iCal" to set icalVersion to version as string
set txtItems to text items of icalVersion
set AppleScript's text item delimiters to {""}
set icalVersion to text 1 thru 3 of ((txtItems as string) & "0")
{txtItems, icalVersion}



--> {{"2.0.2"}, "2.0"}



Version 2.1 (80)
AppleScript 1.10
Tiger 10.4.2
Processor: 867 MHz PowerPC G4

-- david in maine


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Faulty text item delimiters
      • From: Paul Berkowitz <email@hidden>
References: 
 >Faulty text item delimiters (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Faulty text item delimiters
  • Next by Date: Re: Faulty text item delimiters
  • Previous by thread: Re: Faulty text item delimiters
  • Next by thread: Re: Faulty text item delimiters
  • Index(es):
    • Date
    • Thread