tell application "AppleWorks 6"
activate
if document kind of document 1 is not database document then error "Document 1 is not a database !"
tell document 1
set liste1 to index of every record whose visible is true
set liste2 to index of every record whose visible is false
set liste3 to {}
repeat with r from 1 to count of records
if visible of record r is true then copy r to end of liste3
end repeat
end tell -- document 1
end tell -- AppleWorks
"liste1 : " & my recolle(liste1, ", ") & return & "liste2 : " & my recolle(liste2, ", ") & return & "liste3 : " & my recolle(liste3, ", ")
--=====
on recolle(l, d)
local t
set AppleScript's text item delimiters to d
set t to l as text
set AppleScript's text item delimiters to ""
return t
end recolle
--=====
The result is really foolish:
"liste1 : 2, 3
liste2 : 2, 3
liste3 : 1, 4, 5, 6, 7, 8, 9, 10"
liste1 claims that visible of records 2 & 3 is true
but
liste2 claims that visible of records 2 & 3 is false.
Happily, liste3 gives the correct list.
So, at this time, I'm forced to use a loop when a whose clause was the theorical best choice.
Any idea to get a correct result with whose ?
Yvan KOENIG (VALLAURIS, France) lundi 21 septembre 2009 15:51:10