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.

writing to fmp table from applescript

Featured Replies

Hello, I wrote an applescript program to gather the creation date of a specific file.

The result is to be returned to the same table the parameter came from.

Unfortunately the command line set cell "Infile::CreatedTime" to fileinfor

does not return the information into the field "CreatedTime"

I've also tried :

adding "of current record" 

- something like "set cellValue of cell "CreatedTime'" to fileinfor

 

Would someone have an idea why the information is not being returned to CreatedTime?

 

Many thanks!

Screen Shot 2019-10-15 at 12.01.14 PM.png

There are several syntax forms to set a field. I believe the simplest one to use here would be:

set cell "CreatedTime" of current record to fileinfor

Note that it's not necessary to use a fully-qualified name for a local field, although:

set cell "Infile::CreatedTime" of current record to fileinfor

should work just as well.

 

1 hour ago, DPaquin said:

Unfortunately the command line set cell "Infile::CreatedTime" to fileinfor

does not return the information into the field "CreatedTime"

I believe you are mistaken about that. It does modify the field - but without the of current record part it will act on the first record of the current found set.

 

Edited by comment

  • Author

Thanks Comment,

Unfortunately the command execute and nothing get recorded onto CreatedTime.

As you can see the script is going through a loop (3 records). The example being showed is at the second record. CreatedTime for record one and two were not recorded.

The display dialog box command in the applescript function is being showed after the 

set cell "CreatedTime" of current record to fileinfor

has been executed.

Screen Shot 2019-10-15 at 2.25.41 PM.png

Screen Shot 2019-10-15 at 2.15.23 PM.png

Do you not get an error? From what I can see, you are trying to modify a new, uncommitted record. You should get an error message saying:

Data is being accessed by another user, script, or transaction.

  • Author

Bizarre.

I am not getting any error messages. I've moved the perform applescript command after committing the record. Same behaviour no error messages.

Screen Shot 2019-10-15 at 2.51.26 PM.png

Once again,  I cannot reproduce the problem from your description. Can you post a simple file that shows this behavior (and if possible, nothing else)?

 

  • Author

Thanks Comment, 

I've re-executed the script with having the script debugger turned on. I had an error message appearing. It's now working.

Many many thanks! 

With regards!

Screen Shot 2019-10-15 at 3.28.27 PM.png

Edited by DPaquin

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.