Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.filemaker > #1669

Re: Applescript weirdnesses

From Erik Appeldoorn <ursus.kirk@gmail.com>
Newsgroups comp.databases.filemaker
Subject Re: Applescript weirdnesses
Date 2014-01-24 17:44 +0100
Organization A noiseless patient Spider
Message-ID <lbu59v$qmd$1@dont-email.me> (permalink)
References <ws21-16E223.16155623012014@70-3-168-216.pools.spcsdns.net> <ws21-936F55.11375524012014@70-3-168-216.pools.spcsdns.net>

Show all headers | View raw


Bill Steele schreef op 24-1-2014 17:37:
> In article <ws21-16E223.16155623012014@70-3-168-216.pools.spcsdns.net>,
>   Bill Steele <ws21@cornel.edu> wrote:
>
>> Several things driving me up the wall today...
>>
>> 1. usually this works:
>>
>> tell layout "whatever"
>> repeat with i from 1 to (count of records)
>> set foo to cell "name" of record i
>> ...etc.
>>
>> Worked yesterday, in fact.  Today I get "object not found" with "count
>> of records" highlighted.
>>
>> 2.
>>
>> tell app "Filemaker Pro"
>>      tell database "MyData"
>>          tell layout "layout 1"
>>              set foo to cell "stuff"
>>      end tell
>>          end tell
>> (do some processing on foo to get bars)
>>          tell layout "layout 2"
>>          create new records with data {bar1, bar2}
>>          end tell
>>
>>          tell layout "layout 3"
>>      (do some stuff and create a new record)
>>          end tell
>>
>> Two problems:
>>      a. Layout 2 appears while being processed. I don't want the user to
>> see this.
>>
>>      b. Layout 3 does not appear, and instead of making its new record,
>> the new record is added to layout 2. Why doesn't the tell process work
>> the same for each layout?
>>
>> Should be noted that each layout is in a different table.
>
> After a bit more experimenting, it seems that whatever instruction is in
> the script is applied to whatever layout happens to be in front, no
> matter what object you;re telling it to. I would classify this as a bug
> in a supposedly object-oriented language.
>
> So the ideal would be to have a way to direct an instruction to a
> particular layout while it's behind the scenes. The one kluge I've
> thought of is to open it in a new window that's one or two pixels square.
>

Don't know much about apple script. But it is default FMP behaviour that 
you can either access a field through a relationship OR it has to be on 
a layout somewhere. Shrinking won't help you much because of all the 
extra stuff (close/maximize etc)

Is there any special reason you are opting for applescript? Everything 
you are showing here can be done natively in FMP. so you don't need to 
rewrite your scripts again when apple decides to change applescript.

-- 
met vriendelijke groeten,
Erik Appeldoorn

Back to comp.databases.filemaker | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Applescript weirdnesses Bill Steele <ws21@cornel.edu> - 2014-01-23 16:15 -0500
  Re: Applescript weirdnesses Bill Steele <ws21@cornel.edu> - 2014-01-24 11:37 -0500
    Re: Applescript weirdnesses Erik Appeldoorn <ursus.kirk@gmail.com> - 2014-01-24 17:44 +0100
      Re: Applescript weirdnesses Bill Steele <ws21@cornel.edu> - 2014-01-31 16:31 -0500
        Re: Applescript weirdnesses "E. Appeldoorn" <ursus.kirk@ziggo.nl> - 2014-02-01 00:09 +0100
          Re: Applescript weirdnesses Howard Schlossberg <howard@nospam.fmprosolutions.com> - 2014-01-31 17:03 -0800
        Re: Applescript weirdnesses Helpful Harry <HelpfulHarry@BusyWorking.com> - 2014-02-01 12:57 +1300

csiph-web