Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6487 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

I have the following script:

tell application "FileMaker Pro"

		go to layout layoutName of database databaseName

		show every record of database databaseName

		-- this should do the find, but for some reason, I cannot enter data into a calc field - even in a find request

		delete every request

		set myRequest to create request of layout layoutName 

		set cell mySearchField of myRequest to mySearchText

		find

end tell

For some reason, when mySearchField is a calculation field, I get a "Write permission denied" error in AppleScript. Even those if I get permission on the field it shows I have write permission. I can also manually search in this field on the layout that works. If I change it to a regular text field, it works fine.

I'm sure this worked in previous versions. Is there a reason why I cannot seem to search in a calc field using AppleScript?

Thanks.

Edited by Guest
Posted

Well searches have changed nature now we also have constrain found set etc. So the need to show all records initially makes no point any more, I would instead try something in the vicinity of:

tell application "FileMaker Pro Advanced"

set theSearchValue to 1

set theField to "Diff"

show (every record whose cell theField is theSearchValue)

end tell

Where theField is a calc'field ...here called "Diff"

--sd

Posted

Does it all have to be done through Applescript?

If most of it has to be written in Applescript, you can create a Filemaker Script named "Find Something" that does the following:

Enter Find Mode

set field "calc" to "4"

Perform Find

So your applescript would look like

tell application "FileMaker Pro Advanced"

tell window 1

go to layout "Main"

show every record

do script "Find Something"

end tell

end tell

OR

You can create a filemaker script that does the following:

Go to Layout [Layout Name]

Show All Records

Enter Find Mode

Set Field[ table::calc ; "4"]

Perform Find

is there a reason you're doing it all in Applescript?

Posted

The reason I've done it in AppleScript is that the data comes from another application. I've managed to work around it by setting a global search field and then calling on FM to run a script to do the search.

But this used to work. Yes, the workaround works, but why should I have to use it? Searching in a calc field through AppleScript should be a perfectly reasonable thing to do. Ah well. Thanks for the replies.

Posted

In your consideration must the matching features from this:

http://www.filemaker.com/help/Script-Steps66.html

...be considered as well!

--sd

This topic is 6487 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.