Jump to content
Server Maintenance This Week. ×

Converted scripts from FM 6 to 10 not working


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

Recommended Posts

  • 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??

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 5250 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.