Re: Faulty text item delimiters
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