Re: AppleScript broken in 10.5.4
Re: AppleScript broken in 10.5.4
- Subject: Re: AppleScript broken in 10.5.4
- From: Scott Babcock <email@hidden>
- Date: Thu, 9 Oct 2008 16:08:58 -0700
- Acceptlanguage: en-US
- Thread-topic: AppleScript broken in 10.5.4
Using undocumented behaviors is always a bit sketchy, since these can be absent in some contexts and may vanish with each new release. I just recently discovered that an undocumented behavior of the Standard Additions "read" event doesn't exist in the AppleScript Studio context:
Undocumented usage:
set fileData to (read file theFilePath as Unicode text) -- no open/close
Documented equivalent:
set fileNum to (open for access file theFilePath)
set fileData to (read fileNum as Unicode text)
close access fileNum
The undocumented usage works in many contexts, but not in an AppleScript Studio application. It's just better to avoid these sorts of issues by refraining from the use of undocumented behaviors.
-----Original Message-----
Date: Thu, 2 Oct 2008 13:54:27 -0500
From: Luther Fuller <email@hidden>
Subject: Re: AppleScript broken in 10.5.4
To: Applescript Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset="us-ascii"
On Oct 2, 2008, at 9:21 AM, Bob Anderson wrote:
> The following script works in 10.4.x but fails in 10.5.4. Suggestions?
>
> set digitlist to every item of "0123456789"
Before we go into never-never land ... Run this!
set someText to "abcdefgh0123456789"
set AppleScript's text item delimiters to {""} -- the default value
text items of someText --> {"a", "b", "c", "d", "e", "f", "g", "h",
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}
set AppleScript's text item delimiters to {"h0"}
text items of someText --> {"abcdefg", "123456789"}
set AppleScript's text item delimiters to {"pdq"}
text items of someText --> {"abcdefgh0123456789"}
The results you get with 'text items' depends on the value of 'text
item delimiters'.
_______________________________________________
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