Re: Getting the labels of a record (revisited): Part 1 of 2
Re: Getting the labels of a record (revisited): Part 1 of 2
- Subject: Re: Getting the labels of a record (revisited): Part 1 of 2
- From: Kai <email@hidden>
- Date: Mon, 12 May 2003 08:42:50 +0100
on Sun, 11 May 2003 17:28:27 -0700, Paul Berkowitz wrote:
>
On 5/11/03 3:03 PM, "Kai" <email@hidden> wrote:
>
>
> -------------------------------------------------------
>
> (Any wrapped lines abutting the left edge of the window
>
> should be reconnected to the end of the previous line)
>
> -------------------------------------------------------
>
>
Sure, but can't you indent, please? That's just unreadable, in spite of its
>
short lines.
The ideal format can be elusive when posting here, and I opted for left
alignment some time ago in an attempt to minimise the number of lines that
get folded - and therefore have to be rejoined. (I usually copy posted
scripts and paste them into Script Editor for easier reading.)
But... sure, if it bothers you that much:
--================================
to getKeys from r with dupes
tell r's class to if it is not record then error "Can't get keys
from " & it & "."
local dupes
set r to {r} as string
script s
property a : (ASCII character 199) & "class "
property z : ASCII character 200
property o : ASCII character 0
property d : r
property k : {}
property m : 0 - 8
on val(x)
set {t, v} to {d's text (x - 3) thru x, 0}
repeat with n from 1 to 4
set c to t's item n
if c is not o then set v to v + (ASCII number c) * (256
^ (4 - n))
end repeat
v
end val
on nxt(n)
set m to m + n
if d's text (m + 1) thru (m + 4) is "reco" then return rec()
set m to m + 8
tell val(m) to set m to m + it + it mod 2
end nxt
on usr()
set m to m + 20
repeat val(m - 4) div 2 times
set m to m + 8
tell val(m) to set {q, m} to {d's text (m + 1) thru (m +
it), m + it + it mod 2}
if dupes or q is not in k then set k's end to q
if d's text (m + 1) thru (m + 4) is "list" then
lst()
else
nxt(0)
end if
end repeat
end usr
on lst()
set m to m + 16
repeat val(m - 4) times
nxt(0)
end repeat
end lst
on rec()
set m to m + 16
repeat val(m - 4) times
set n to d's text (m + 1) thru (m + 4)
if n is "usrf" then
usr()
else
tell (run script a & n & z) as string to if dupes or
it is not in k then set k's end to it
nxt(4)
end if
end repeat
end rec
if d starts with "d" then set m to 8
tell rec() to k
end script
run s
end getKeys
--================================
--
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.