Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

copying data from one file to another

Featured Replies

Hi,

this script technically works apart from one snag .. (its only a test script to ensure that the connectivity of files and data function correctly)

tell database "central.fp5"

set accessID to cell "AccessID" of current record as text

end tell

tell database "TBcentral.fp5"

set cell "gAccessNumber" to accessID as text

do script "enter find mode"

do script "perform ID search"

find

set cell "gAccessNumber" to ""

get cell "First Name" of current record

end tell

The two fmscripts "enter find mode" and "perform ID search" are created within the database "TBcentral.fp5", the first script just sets the view to find mode, the second, copies the "gAccessNumber" field into the cell "AccessID" then performs the find.

This is so I can isolate the record in the second databse to update details.

The script does work but only given that I make the "TBcentral.fp5" database visible using:

set visible of window "TBcentral.fp5" to true

placed just before the line

tell database "TBcentral.fp5"

otherwise the applecript can't find the fmscript at line

do script "enter find mode"

- I don't want to have the second database showing at all on screen, as the file is merely a backup of relevant fields that will be accessed by an ODBC application sending the results to an accounts datafile. I'd like th users of the system to just be able to click on an update button for a particular record and it to update the second database in the background. Is there a way around this ?

Maybe using an external script fetaure from the primary database "central.fp5"

I hope i've explained this correctly.

thnx.

Why use Applescript and not Filemaker's scripting?

  • Author

ahh, creating a relationship between the two files, creating a layout which contains the fields i want to update and then use the set Field[ ] command.

I would have to have the screen switch to the newly created layout to do so would i not, whilst the update occurred, then return the user back to the originating screen ?

I can't see a way for this to happen in the background out of view.

Set Field does not require the field to be on the screen. Setting a field through a relationship does not activate the other database file. Finally the Freeze Window script step will do just that, it will freeze the display temporarily.

However this all will happen so quickly that even if you have an actual script in the other DB, it will at most cause a momentary screen flicker.

I suggest trying this in Filemaker before involving Applescript, unless you really like pain and anguish and really want to waste time.

  • Author

Kurt,

Thanks for the wise guidance... I guess I was just making things more difficult than they needed to be .. I don't know why I couldn't see the simplicity in the situation.

I've set up a relationship to the secondary file from the primary and created a scrpt with set Field .. and bang, just what i needed to happen. grin.gif

a valuable lesson learned in simplicity.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.