3 Replies Latest reply on Aug 12, 2010 2:09 PM by areohbee

    ?:0: attempt to call upvalue '?' (a nil value)

    Jonathon LeFaive Level 3

      I can't seem to get rid of this error (' ?:0: attempt to call upvalue '?' (a nil value) ').  What is "?:0:" ?

       

      Thanks in advance for any help!

       

      script:

       

      local LrApplication = import 'LrApplication'
      local LrDialogs = import 'LrDialogs'
      local LrFileUtils = import 'LrFileUtils'
      local catalog = LrApplication.activeCatalog()
      local LrTasks = import 'LrTasks'

       


          function searchNtag()
              local targPhotos = catalog.getAllPhotos()
              for _, photo in ipairs(targPhotos) do
                  local status = photo:getPropertyForPlugin('com.jonathonlefaive.tagstatus', 'tagboolean')
                  if status then
                      if status == nil then
                          local location = photo:getRawMetadata('path')
                          if LrFileUtils.isDeletable(location) == true then
                              photo:setPropertyForPlugin('com.jonathonlefaive.tagstatus', 'tagboolean', false, 2)
                          else
                              photo:setPropertyForPlugin('com.jonathonlefaive.tagstatus', 'tagboolean', true, 2)
                          end
                      end
                  end
              end
          end

       

      function task()
          catalog.withPrivateWriteAccessDo(searchNtag)
      end

       

      LrTasks.startAsyncTask(task)