Re: Getting the labels of a record
Re: Getting the labels of a record
- Subject: Re: Getting the labels of a record
- From: Kai <email@hidden>
- Date: Wed, 16 Apr 2003 07:26:09 +0100
on Wed, 16 Apr 2003 01:11:08 +0100, John Delacour <email@hidden> wrote:
>
[ Sent from Eudora as UTF-7 ]
>
>
At 11:38 pm +0100 15/4/03, Kai wrote:
>
>
>A very interesting approach, John!
>
>
>
>I haven't tested the following variation exhaustively - but it seems to work
>
>reasonably well here (with what I've thrown at it so far, at least)...
>
>
>
I'll look forward to trying it out in the next day or two. First run gave me
>
>
"Can't get text 5 thru 170 of
>
+AFw"+AAAAAAABALYAAAAAAAAAAQAAAAAAAAAA-usrflist+AAAAAAABAO0AAAAAAAA
>
+AAAAAAAAAAAAXA"."
What - you broke it already? (Thought you might - but you could have taken a
little longer!) ;-)
I'm currently working on a pre-OS X machine, so there may well be some
differences in behaviour. I've been through the code OMM, and the character
count of the current string generally exceeds the ASCII number of it's
fourth character (where it needs to).
However, I've added a trap that might help to avoid that particular problem:
====================
to getStrings from l
set s to l's strings
repeat with i in l's lists
tell (getStrings from i) to if it is not {} then set s's end to it
end repeat
s
end getStrings
to getkeys from r
set {l, text item delimiters} to {getStrings from r, ASCII character 1}
set {k, n, l, s, text item delimiters} to [NoBreak]
{{}, 4, (l as string)'s text items, {r} as string, "TEXT"}
set {s, m, text item delimiters} to [NoBreak]
{s's text items 2 through -1, n + 1, {""}}
repeat with i in s
set {c, e} to {count i, n + (ASCII number (i's character n))}
if c is not less than e and e > n and "type" is not in i then [NoBreak]
tell i's text m through e to if it is not in l then set k's end to it
end repeat
k
end getkeys
tell application "Finder" to set r to {Key_1:{"a", 3.87, [NoBreak]
{Sub_Key_A:"A"}, name, ""}, Key_2:2, Key_3:"hello", [NoBreak]
Key_4:{current date, 3 / 77}, Key_5:{"oooo", {Sub_Key_B:"B"}, string, list}}
getkeys from r
--> {"key_1", "sub_key_a", "key_2", "key_3", "key_4", "key_5", "sub_key_b"}
====================
- that is, until you find some other way to break it...
>
and it's bedtime, so that's that for now.
You're right - and it's way past mine, too!
--
Kai
_______________________________________________
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.