9 Replies Latest reply on Jul 14, 2010 12:57 PM by sandwicense

    How do I use the LrPublishService Namespace?

    sandwicense

      I can't seem to get the LrPublishService to work so I can access it's functions.  I don't see anything wrong with what I'm doing, hopefully someone can point out what I'm doing wrong or if I misunderstood something in the docs.

       

      This is what I have for my code:

       

       

      local LrApplication = import 'LrApplication'
      
      local LrCatalog
      local LrPublishService
      
      LrTasks.startAsyncTask(
           function()          
           LrCatalog = LrApplication.activeCatalog()
           LrPublishService = LrCatalog:getPublishServices(_PLUGIN.id)
              LrPublishService:createPublishedCollection('My Sample Collection')
           end, --end async function
           'publish service test'
      ) --end async task
      

       

      Lightroom throws the error 'attempt to call method 'createPublishedColection' (a nil value)when trying to execute this line of code: LrPublishService:createPublishedCollection('My Sample Collection').

       

      The table returned by LrCatalog:GetPublishServices() looks like {{}} when I convert it to a string.  I'm confused at how to make use of the LrPublishService namespace.  What I am trying to ultimately do is create collections programmatically when the user creates a new publish service.

       

      Any help is greatly appreciated, thanks.