Skip to main content
Known Participant
May 6, 2025
Answered

A very simple script lua failing

  • May 6, 2025
  • 1 reply
  • 255 views

Hi, this is a simple script lua to verifiy loading test plugin in lightroom. It returns ...nothing:

 

-- main.lua (test de notification simple et correct)
local LrApplication = import 'LrApplication'
local LrFunctionContext = import 'LrFunctionContext'
local LrDialogs     = import 'LrDialogs'

function onPluginLoaded(plugin)
  LrFunctionContext:postUserNotification({
    title = 'Test de Notification (Nouveau Format)',
    message = 'Le plugin de test a été chargé avec le nouveau format Info.lua.',
  })
end

LrDialogs.message("Début main")
return {
  onPluginLoaded = onPluginLoaded,
}

 

 

et le fichier info.lua: 

-- Info.lua
return {
  LrSdkVersion = 6.0, -- Ou une version plus récente
  LrToolkitIdentifier = "com.example.simple-caller",
  LrPluginName = "SimpleCaller",
  LrPluginInfoString = "Appelle un script simple",
  LrPluginRequiredAgExports = {},
  LrLibraryMenuItems = {
        {
            title = "Appel simple...",
            file = "main.lua", -- Fichier qui sera exécuté
            enabled = "requireSelection",
        },
    },
}

, thank you for help 

Correct answer johnrellis

When I make a plugin with those two files, add the plugin to File > Plug-in Manager, and then do the menu command Library > Plug-in Extras > Appel Simple..., I see the message:

 

Was this generated by AI, by any chance?  There are numerous things in those two files that aren't even close to being correct. Trying to use AI to get started with LR plugin development is a waste of time, in my opinion.  See here for tips on how to get started:

https://community.adobe.com/t5/lightroom-classic-discussions/sample-code-for-a-publish-service/m-p/7592483#M164982

1 reply

johnrellis
johnrellisCorrect answer
Legend
May 6, 2025

When I make a plugin with those two files, add the plugin to File > Plug-in Manager, and then do the menu command Library > Plug-in Extras > Appel Simple..., I see the message:

 

Was this generated by AI, by any chance?  There are numerous things in those two files that aren't even close to being correct. Trying to use AI to get started with LR plugin development is a waste of time, in my opinion.  See here for tips on how to get started:

https://community.adobe.com/t5/lightroom-classic-discussions/sample-code-for-a-publish-service/m-p/7592483#M164982

Known Participant
May 6, 2025

thank you John i will follow your advice and read carefully these documents, as you say maybe it's worth wasting two hours reading that and understanding it instead of expecting an operationnal script without understanding anything...