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


i can't seem rid of error (' ?:0: attempt call upvalue '?' (a nil value) ').  "?:0:" ?

 

thanks in advance 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()
        _, 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)

catalog.func should catalog:func (colon instead of dot)

 

i.e. catalog functions object methods not static functions.

 

ps - not sure meaning of cryptic error message think problem.

 

rob



More discussions in Lightroom SDK


adobe

Comments

Popular posts from this blog

Gavik Photoslide GK2: Not able to upload photos - Joomla! Forum - community, help and support

How to decompile jsxbin to jsx

Thread: networkmanager's dsl connection can't have static LAN ip?