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.

Converted scripts from FM 6 to 10 not working

Featured Replies

  • Newbies

My applescripts don´t work after converting from FM 6

In FM 6 something like this worked:

tell application "Filemaker Pro"

set Mappenavn to cell "Ordrenr" of current record as string

In FM 10 this doesn´t work unless the field "Ordrenr" is on the layout that are visible when the script runs..

This is quite funny since the "Ordrenr" of current record is unique??

I have to be able to call this field from any layout??

Have you consulted the changes in the object model? The switch to the TOG approach have urged the use of either the layout object or the new object "table" there is no layout 0 any more ... you seems danish, give me a mail off forum if needed.

--sd

  • Author
  • Newbies

Hi

Almost Danish B)-) - Norwegian

Jeg skjønte ikke helt svaret ditt ?

kan du forklare litt nærmere tror du?

Jeg skal lige vide har du læst på Whitepaper'et der omhander migration af løsninger? Du skulle have observeret at der både er noget som hedder TO og TOG og at det faktisk ikke rigtigt giver mening at skrive direkte til tabeller, der er altid en sammenhæng de fremtræder i, typisk et layout.

Sådan har det faktisk været hele tiden, men i de gamle versioner var tabeller hvis de blev brugt åbne, og der var ikke meget tvivl om hvilket aspekt man talte til. Desuden havde man lavet et Layout 0 hvor man kunne læse og skrive til selvom et layout var usynligt.

Med den nye version kan der i hver eneste layout være forskellige fundne sets med hver deres egen "current record" - fordi de hører til hver sin TOG og det er her det væsentligste paradigmeskift er indtrådt.

Men du løser dit problem lettest ved at lave en tell layout nn - end tell set udenom hvad du allerede har og så indledningsvis sikrer dig at det layout viser alle kort.

Men så er der et spørgsmål der trænger sig på, hvorfor laver du ikke dette med interne værktøjer?

http://www.databasepros.com/FMPro?-DB=resources.fp5&-lay=cgi&-format=list.html&-FIND=+&resource_id=DBPros000842

--sd

English Please.

OK...but slightly rewritten, with some extra considerations included.

Have you read the migration whitepaper, in it should you have encontered the difference between TOG's and TO's, and that i doesn't make much sense to write directly to a table, but instead the context where it's displayed.

This is actually what it used to be as well with the pre fm7, but there wasn't much doubt which found set you were adressing, although there was a layout 0 for getting to the table/files data without a window showing it. But usually was an open file/table shown in an extra window.

With the new version could all tables and layouts easily reside in the same file and several table occurrence groups of with the same table shown, could easily have each their own current record as well as a specific found set each.

You can read/write to the object "table", but there is then neither found set nor a current record you can write to the first and to last record but the ones in between takes a lot of shenanigans to get ... but a counter intuitive aspect of this is if you have a layout showing a layout belonging to the TOG associated with the table, and the found set is everything omitted, will the script loop endlessly.

But as such would you probabaly solve you problem by putting what you already have into a tell table nn/end tell clause, but I can only encourage embracing the relational model and use a specific layout/TOG for the purpose only to prevent the endless loop issue. The benefit is you can make found sets, and single out records on their values.

But a question urges her, why not use a native scriptmaker method instead of relying on Applescript.

http://www.databasepros.com/FMPro?-DB=resources.fp5&-lay=cgi&-format=list.html&-FIND=+&resource_id=DBPros000842

--sd

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.