Sunday, October 13, 2019

#1 2019-07-05 07:11:29 pm

brian_donovan
Member
Registered: 2003-11-10
Posts: 147

Setting a Repeating field in FileMaker

Sorry for this simple question, I was sure I knew how to do this but my technic did not work....Pleas help I cant find the answer in google.

I am trying to set a field with AppleScript in FileMaker 15 this is the code I have now:

Applescript:


tell application "FileMaker Pro"
   set cell "Name" of current record to "Mike" as text
end tell

It works perfect but if the field “Name” has repetitions and I would like the text “Mike” in the second repetition something like this is needed:


Applescript:


tell application "FileMaker Pro"
   set cell "Name[2]" of current record to "Mike" as text
end tell

but it does not work.... help!!! how do I do it? sad

Offline

 

#2 2019-07-05 10:37:01 pm

KniazidisR
Member
Registered: 2019-03-03
Posts: 614

Re: Setting a Repeating field in FileMaker

1) Most likely, you have not yet assigned a name to the second cell, therefore you refer to a non-existent name "Name[2]" and  2) no need command as text, since "Mike" is already text.

By default, all cells are named  similar to "A2", indicating cell of column "A" and row "2", until you yourself give them some other name. I do not have FileMaker Pro on my computer, so check what I said yourself.

Last edited by KniazidisR (2019-07-05 10:59:22 pm)


macOS Mojave -- version 10.14.4
Safari -- version 12.1

Offline

 

#3 2019-07-07 11:14:55 am

brian_donovan
Member
Registered: 2003-11-10
Posts: 147

Re: Setting a Repeating field in FileMaker

Thank you for replaying but in filemaker repeating fields have the same name and the [2] that I added is a way to get or set values in repeating fields but from within filemaker that is why I had the idea this will also work in AppleScript but I was wrong or its a filemaker bug I dont know. thanks any way

Last edited by brian_donovan (2019-07-07 11:15:44 am)

Offline

 

#4 2019-07-07 11:30:04 am

brian_donovan
Member
Registered: 2003-11-10
Posts: 147

Re: Setting a Repeating field in FileMaker

Hi, just to let you know that this is the right code:

Applescript:


tell application "FileMaker Pro"
   set repetition 2 of cell "Name" of current record "Mike"
end tell

it has to have the current record for this to work! good day!!!!

Offline

 

#5 2019-07-07 12:08:50 pm

KniazidisR
Member
Registered: 2019-03-03
Posts: 614

Re: Setting a Repeating field in FileMaker

brian_donovan wrote:


it has to have the current record for this to work! good day!!!!



I'm glad you found yourself a solution to a problem, that might be useful to other FileMaker Pro users. As I said, I do not have this application, which means that I do not have its scripting dictionary too, which I could experiment with.


macOS Mojave -- version 10.14.4
Safari -- version 12.1

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)