• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
sometimes, true = false !
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sometimes, true = false !


  • Subject: sometimes, true = false !
  • From: Yvan KOENIG <email@hidden>
  • Date: Mon, 21 Sep 2009 15:53:26 +0200

Trying to help a user, I wrote a script wich gave odd results.

I dropped  a lot of things and reduced it to this bare one:

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


 _______________________________________________
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

  • Follow-Ups:
    • Re: sometimes, true = false !
      • From: Axel Luttgens <email@hidden>
  • Prev by Date: Re: do shell script "command not found"
  • Next by Date: Re: Strange Comment Problem
  • Previous by thread: iTunes "Manually Manage Music and Videos" property
  • Next by thread: Re: sometimes, true = false !
  • Index(es):
    • Date
    • Thread