1 Reply Latest reply on Jun 3, 2015 6:43 AM by johnrellis

    Help on writing mini-plugin to run windows .exe on photo

    Beholder003 Level 1

      Hi,

       

      I seek to run the windows version of dcraw on a selected picture via plugin and then have the plugin automatically import the resulting TIF image back into LR so it is displayed beside the original raw file.

      I am no developer at all but understand that plugins can be created with some scripting code.

      I tried something like this here but failed:

       

      local LrTasks = import 'LrTasks'

      local LrApplication = import 'LrApplication'

       

      local catalog = LrApplication.activeCatalog()

          local cat_photos = catalog.targetPhotos   

              for i, photo in ipairs(cat_photos) do

                  local file = photo.path

                      LrTasks.startAsyncTask(function()

                          LrTasks.execute(C:programs/dcrawps64.exe "-T" "-4" "-G" "20" "-v" "  ..file..  ")

                      end)

      end

       

      There are a couple of issues:

      a) is the approach ok generally?

      b) I have serious problems with the path to the application. Quotes or not? forward or backslashes used?

      c) I seem to have same issues with getting the blanks and single and double quotes correct.

       

      Any hints anyone?