MACSCRPT Archives

May 2003

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Eric Schult <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Thu, 29 May 2003 11:34:04 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
I'm converting some FMP 5 scripts to FMP 6 in OS X and dealing with the
broken "whose" command that has been mentioned so many times before on this
list. 

I'm resigned to the not-very-pretty workaround of using request/find
commands in the place of "every record whose". I've seen the other
recommended solutions, including some promising stuff in AS Studio from
Christopher Green, but I'm still too mired in FaceSpan 3.5 to attempt the
jump to AS Studio.

One of my scripts used to read:

try
 set myResults to every record whose ((cell "cellNameA" is "x")  ¬
  and (cell "cellNameB" is not "y"))
on error
 set myResults to {}
end try

The alternate request/find approach to that would be something like:

set firstRequest to (create new request)
set cell "cellNameA" of firstRequest to "x"
set secondRequest to (create new request with omitted)
set cell "cellNameB" of secondRequest to "y"
find
tell document 1
 set myResults to every record
end tell

There's a thing or two wrong with the alternate approach, though. First, it
doesn't seem to include the secondRequest in its search criteria. I get the
same results if I leave out the 3rd & 4th lines (i.e. "set secondRequest..."
and "set cell "cellNameB ..."). Apparently I need to tweak my syntax just a
little. 

Any guidance out there? Thanks in advance!


- WES

ATOM RSS1 RSS2