LuaToFM Filemaker plugin

Enhance Your FileMaker Experience with Lua Integration

Introducing LuaToFM, a free powerful plugin that seamlessly integrates Lua scripting into your FileMaker environment. With LuaToFM, you can unlock new possibilities for your FileMaker applications, enhancing functionality and performance.

Execute Lua Code in FileMaker

lu_Evaluate ( "
   function my_sum( a, ... ) 
      local sum = a
      for i, x in ipairs{...} do
        sum = sum + x
      end     
      return sum
   end 
" ) & ¶ & 
lu_RegisterLuaFunction( "my_sum( a { ; ... } )" ; "my sum lua function" )

lu_my_sum( 2 ; 3 ; 4 )

// returns
// 9
LuaToFM allows you to run Lua code directly within FileMaker, enabling you to register Lua functions as native FileMaker functions. This integration empowers developers to leverage the flexibility and efficiency of Lua scripting in their FileMaker solutions.
Persistent Lua Environment

lu_Evaluate ( " 
    a=2
" )  & ¶ & 
lu_Get ( "a" ) 

// returns
// 2
With LuaToFM, you can store data in the Lua environment's memory independently of FileMaker files. This feature ensures that your data remains accessible across different sessions and FileMaker files, providing a robust solution for data management.
Cross-File Access
Access your Lua variables from multiple FileMaker files, both in FileMaker Pro and on the server. This cross-file functionality allows for seamless data sharing and enhances the collaborative capabilities of your applications.
Multiple Lua States

lu_SetToState ( "a = 10" ; "0x15a6eb608" ) & ¶ & 
lu_GetFromState ( "a" ; "0x15a6eb608" ) 

// returns
// 10
LuaToFM supports working with multiple Lua states (environments) simultaneously. This feature ensures safe operation for multiple FileMaker applications or processes running on the same server, preventing conflicts and enhancing stability.
JSON Data Return

lu_Evaluate ( "
  tbl = {
    a = 1,
    b = 'smth text',
    c = { 1, 2, 3 , 4 },
    d = { 
        e = { 'aa', 'bb', 'cc' },
        f =  { 1, 'dddd' , 3 }
        }
   }
"
 ) & ¶ & 
 lu_Get ( "tbl" )

 //  returns:
 // {"c":[1,2,3,4],"b":"smth text","a":1,"d":{"e":["aa","bb","cc"],"f":[1,"dddd",3]}}
Easily return Lua table data to FileMaker in JSON format. This capability simplifies data handling and integration, making it easier to work with complex data structures within your FileMaker solutions.
Special Lua Functions for FileMaker
The plugin includes a dedicated package of Lua functions designed specifically for FileMaker. With these functions, you can:
  • Perform direct SQL queries to the FileMaker database without relying on ODBC or APIs.
  • Execute FileMaker scripts directly from Lua.
  • Store data in FileMaker global variables.
  • Call FileMaker functions from Lua code, streamlining your workflow.

lu_Evaluate ( "
   cnt, res = LuaToFM.executeFMSQL ( {
      file = 'Ltest',
      query = 'SELECT id, test_text FROM LTest WHERE id > ? AND id < ? ',
      params = { 17,  21 }
})
" ) 
Why Lua?
Lua is an exceptionally fast scripting language, renowned for its efficiency and performance. Its lightweight design allows for rapid execution, making it an ideal choice for applications that require quick response times and minimal overhead. This speed is particularly beneficial in environments like FileMaker, where performance is crucial for maintaining a smooth user experience.

One of the standout features of Lua is its design as an embedded language. It was specifically created to be integrated into other applications, providing a straightforward C API that facilitates this process. This makes Lua an excellent fit for FileMaker, where plugins are typically developed in C/C++. The seamless integration capabilities of Lua allow developers to harness its power without compromising the performance or stability of their FileMaker solutions.

By choosing Lua for your FileMaker integrations, you gain access to a robust scripting environment that enhances functionality while maintaining the high performance expected in professional applications. Lua's combination of speed, efficiency, and ease of integration makes it the perfect partner for FileMaker, enabling developers to create sophisticated solutions that meet the demands of modern business environments.
Unleash the Power of External Lua Packages

lu_Evaluate ( " 
  http = require('socket.http') 

  h = http.request('https://odonata.tech')

" )
One of the most exciting aspects of LuaToFM is its ability to leverage the vast ecosystem of existing Lua packages. Lua has a rich history as an embedded language, leading to the development of numerous high-quality, open-source packages that address a wide range of needs. With LuaToFM, you can now seamlessly integrate these packages into your FileMaker solutions, unlocking new possibilities for functionality and efficiency.

By integrating these and other Lua packages with LuaToFM, developers gain access to a vast array of functionality that can be seamlessly incorporated into their FileMaker solutions. This opens up new possibilities for data processing, automation, integration, and more, ultimately enhancing the capabilities and efficiency of FileMaker applications.

© All Rights Reserved. OdonataTech LLC
Made on
Tilda