4 Replies Latest reply on Apr 24, 2012 1:13 AM by areohbee

    recordPublishedPhotoUrl - how to use?

    areohbee Level 5

      I am calling recordPublishedPhotoUrl with what appears to be a valid URL for my photo(s), but I can't see any way to access the URL in Lightroom.

       

      I expected to see a "Go To Photo URL" on a context menu or something, but I've not discovered yet...

       

      Any ideas?

       

      Rob

        • 1. Re: recordPublishedPhotoUrl - how to use?
          areohbee Level 5

          Here's my code for "Go to Photo URL" added to the File Menu (Plugin Extras):

           

          --[[

                  mVisitPhotoOnWeb.lua

          --]]

           

          app:call( Call:new{ name="Browse Photo on Web", async=true, guard=App.guardVocal, main=function( call )

              local mostSelPhoto = catalog:getTargetPhoto()

              if mostSelPhoto == nil then

                  app:show{ warning="Select photo." }

                  return

              end

              local sources = catalog:getActiveSources()

              local pubPhoto

              for i, v in ipairs( sources ) do

                  if v:type() == 'LrPublishedCollection' then

                      local pubPhotos = v:getPublishedPhotos()

                      for j, pp in ipairs( pubPhotos ) do

                          if pp:getPhoto() == mostSelPhoto then

                              pubPhoto = pp

                              break

                          end

                      end

                  end

              end

              if pubPhoto then

                  local url = pubPhoto:getRemoteUrl()

                  if url then

                      app:show{ info="Consider clearing browser cache before proceeding.",

                          actionPrefKey = "Clear browser cache prompt",

                      }

                      LrHttp.openUrlInBrowser( url )

                  else

                      app:show{ warning="No URL recorded." }

                  end

              else

                  app:show{ warning="Can't find published photo - try from a published collection." }

              end

           

          end } )

           

          return true

           

          PS - the app-call stuff is like a named recursion-guarded asynchronous function call with error-handling...

          • 2. Re: recordPublishedPhotoUrl - how to use?
            johnrellis Most Valuable Participant

            For the built-in Flickr and SmugMug services, the context menu for published photos has "Show in Flickr" and "Show on SmugMug".  

            • 3. Re: recordPublishedPhotoUrl - how to use?
              johnrellis Most Valuable Participant

              ...so I wonder what might going on in your case? 

              • 4. Re: recordPublishedPhotoUrl - how to use?
                areohbee Level 5

                Strange, it's working now. I think Lightroom crashed and I re-opened it. - I guess that's what it needed .

                R