6 Replies Latest reply on Jun 15, 2009 10:17 AM by escouten

    Problem with autofill Export standard fields

    vpolozov

      Hi,

       

      I'm trying to write primitive export action: I want to export photo to some folder and put it to autonaming subfolder. Basic idea is to use the same name, as photo folder:

       

      local LrApplication = import 'LrApplication'

      local LrPathUtils = import 'LrPathUtils'

       

      local activeCatalog = LrApplication.activeCatalog()

      local filmstrip = activeCatalog.targetPhotos

      local parentfolder

      activeCatalog:withReadAccessDo( function()

           local photo = activeCatalog.targetPhoto

           parentfolder = LrPathUtils.leafName(LrPathUtils.parent(photo.path))

      end )

       

      First, I tried to get .lrtemplate file, and modify it

            export_destinationPathSuffix = ...,

      But it fails on either import!

       

      Then I tried to create LrExportServiceProvider with preset and startDialog method: skip export_destinationPathSuffix in preset and setup propertyTable.LR_export_destinationPathSuffix in startDialog. But when I'm chosing my preset: it sets up correct value, and the blinks and sets up "Untitled Export" value! I can add an observer to LR_export_destinationPathSuffix, but it will update field, not view.

       

      To reproduce:

      - import attached plugin

      - select export

      - choose any other preset

      - choose "Folder->MakeFolder" preset

      You will see Subfolder name blinking, and the new value is "Untitled Export"

       

      Can anybody help me with this stuff?

       

      Victor.

        • 1. Re: Problem with autofill Export standard fields
          escouten Adobe Employee

          Hi Victor, I haven't looked at your plug-in specifically, but first I'm wondering what is the intended behavior: What happens if you have photos from multiple folders selected (i.e. you're in a collection when you go to export)? Looking at the code snippet you've shown below, I suspect it would choose the folder of the most-selected photo and apply that to all of the exported photos.


          Another way to approach this would be to let Lightroom render the photo to the folder it's aiming for and then physically move the photo afterwards via your processRenderedPhotos method. I haven't specifically tried this, but it might be a path of least resistance.

          1 person found this helpful
          • 2. Re: Problem with autofill Export standard fields
            vpolozov Level 1

            Yes, folder from most-selected photo is ok for me.

            Another similar behavior, that I wanted to implement: create new subfolder with autogenerated name (And then run panorama stitching software on all files in the folder).

             

            Implementing processRenderedPhotos to move files is good idea. So I will need temp folder to render photos, and target folder introduced by my plugin.

            Drawback is that I will loose "Ask what to do with existing files" functionality.

            I will try, thank you for advise.

             

            Victor

            • 3. Re: Problem with autofill Export standard fields
              escouten Adobe Employee

              Sure, no problem.

              • 4. Re: Problem with autofill Export standard fields
                DawMatt Level 3

                Victor,

                 

                I thinkthis plugin of mine does most of what you want, using the technique Eric describes.  It also explicitly allows you to configure whether to overwrite files or not.

                 

                I've been meaning to open its source.  If you need to extend it or want an additional feature let me know and I can see if I can oblige.

                 

                Matt

                • 5. Re: Problem with autofill Export standard fields
                  vpolozov Level 1

                  Just found, that LrExportServiceProvider without built-in presets do exactly what I want. I initialize LR_ export properties in startDialog function, and nobody overrides these properties with default values after call.

                  The only drawback, that preset menu is more intuitive than ExportService provider.

                   

                  But I'm still wondering, why it is forbidden to do something like "import 'LrApplication'" in .lrtemplate modules?

                  • 6. Re: Problem with autofill Export standard fields
                    escouten Adobe Employee

                    Presets aren't really part of the SDK (at least not in a technical sense), and so none of the SDK environment is available when we run the preset code to extract its data.