Custom import

HI, I'm newbee in coding In Lightroom, and need to design a custom import to import photo automatic in Lightroom. I has coded a few code below using SDK 3.0. I would like to get help from your guys a fews things:
1) It's the code below is the right way to begin?
2) and I also got the error: the path is invalid, og miss when i calling catalog:addPhoto().
I'm very thankfully for help from you guys.
-- Lightroom API
local catalog = import 'LrApplication'.activeCatalog()
local path  = 'C:\\Users\\dev\\Desktop\\Test\\Picture\\camera.jpg'
local LrFileUtils = import 'LrFileUtils'
local LrPathUtils = import 'LrPathUtils'
local LrTask =  import 'LrTasks'
-- Add photo to catalog
catalog:withWriteAccessDo("writeAccess", function(context)
        --syncablePhotos = catalog:getAllPhotos()
        local lrphoto = catalog.addPhoto(path)
end)
-- Code below is just for Test
local LrDialogs = import 'LrDialogs'
MyHWExportItem = {}
function MyHWExportItem.showModalDialog()
    -- body of funtion
    --LrDialogs.message( "ExportMenuItem Selected", "Hello plugins!", "info" )
    if LrPathUtils.leafName(path) then
        local l = LrPathUtils.leafName( path)
        LrDialogs.message("ExportMenuItem Selected", l, "AtutoImportExport")
    else
        LrDialogs.message("ExportMenuItem Selected", "file not found ", "AtutoImportExport")
    end
end
MyHWExportItem.showModalDialog()

Hi Matt, I'm so happy for your help, thanks a lot, and as you said, and the error is now gone, yeahh!!.   But a new error appear right after that, what is wrong?
Here is my code so far:
-- Lightroom API
--local LrFolfder = import 'LrFolder' -- Creating an folder object
local catalog = import 'LrApplication'.activeCatalog()
local path  = 'C:\\Users\\dev\\Desktop\\Test\\Picture\\camera.jpg'
local LrFileUtils = import 'LrFileUtils'
local LrPathUtils = import 'LrPathUtils'
local LrTasks =  import 'LrTasks'
local LrDialogs = import 'LrDialogs'
-- Export to a folder
-- Code below is just for Test
AddPhoto = {}
function AddPhoto.showModalDialog()
    -- body of funtion
    --LrDialogs.message( "ExportMenuItem Selected", "Hello plugins!", "info" )
    -- logger:trace( "updateStatus() is executing." )
    LrTasks.startAsyncTask( function()
        --Add photo to catalog
            catalog:withWriteAccessDo("writeAccess", function(context)
                --local syncablePhotos = catalog:getAllPhotos()
                local lrphoto = catalog:addPhoto(path){}
                --local folders = catalog:getFolders()
        end)
    end)
    if LrPathUtils.leafName(path) then
         local l = LrPathUtils.leafName( path)
         LrDialogs.message("ExportMenuItem Selected", l, "AtutoImportExport")
     else
         LrDialogs.message("ExportMenuItem Selected", "file not found ", "AtutoImportExport")
    end
end
AddPhoto.showModalDialog()

Similar Messages

  • Cannot Change Custom Import Settings For AAC's

    Last night I changed the custom import settings from 192 kbps to 160 kbps for a particular mp3 album I wanted to convert with that bitrate. I tried to change the custom settings back to 192 kbps (the bitrate most of my mp3's & wma's are in). For some reason, the window that came up many times before refuses to pop up now. I tried the custom settings for mp3's and that window still pops up. Anyway, I tried a repair and nothing happened. I uninstalled iTunes, Quicktime, Bonjour, and Apple Software Updates, deleted there corresponding folders in C:/Program Files and then restarted the computer. I downloaded the iTunes 9 installer through the iTunes website and proceeded to reinstall iTunes. Still, the problem exists. I'm not sure what else to do? The only other thing I can think of is to do the same except install iTunes 8 instead and then search for updates and reinstall iTunes 9 that way. Would anyone know of any other method on solving my problem? Any help would be greatly appreciated, thanks!

    glenn,
    I have the same problem and it is driving me crazy. If you find a solution please email me at [email protected]
    thanks and good luck

  • Auditing a Custom Import package

    We are having issues with BPC data auditing on a custom import package.  We are using the convert and dump load tasks just like in the standard import package.  The difference is that we have those surrounded by other SSIS tasks to perform other pieces of the import process.  The specific issue is that when we look at the detailed audit data, we are not seeing all of the records from our custom import.  We usually see that the import package took place, but we also usually see only a small fraction (if any) of the actual records that were posted (and which we can see in BPC) in the audit.
    My first question is, does the "Data Manager Import" option under the audit settings work with custom import packages using the convert and dump load tasks, or is it exclusive to the standard import package?  Secondly, if it does work with custom import packages, what might be some causes and/or resolutions to this issue?

    Just an update on the two issues that we are seeing...
    First, I have tested the standard Import and the Append into Fact Table packages, and both are audited correctly and completely.  This is important because our import package utilizes both of these styles of import.  One set of data is transactional, so it is loaded similar to the Append into Fact Table package.  The other set is a merge style import, so it is very similar to the standard import.  I see all records in the AuditDataFincance table in the Extra database for both of these packages.  This would lead me to believe that we are seeing some interference either between these two dump load tasks in the same package or some other SSIS package.  It is important to note that these dump load tasks are wrapped in foreach loops to pickup all files in a directory.  Looking at the package, my guess would be that either having two dump load tasks or having said tasks wrapped in a foreach loop would probably be the culprit.  My next step will be to strip the package down to test just these pieces.  Does anyone know if either of these would cause an issue with auditing?
    Secondly, I stated that we are not seeing the temp audit files in the STAGED or LOADED folders, which is making it more difficult to debug this issue.  After testing several packages, I noticed that the standard import and clear packages audit correctly, but they never create files in the STAGED or LOADED folders.  However, the Append into Fact Table package DOES create these files.  What I noticed in the AuditHdrFinance table in the Extra database was that the StagingCode values for these packages were different before they were loaded.  A value of 0 signifies that the package has already been loaded.  Append into Fact Table had a value of 1, which appears to signify that an audit file is waiting to be loaded in the STAGED directory.  The others had a value of 2, which I am guessing signifies that they are currently being staged in memory or some other location.  Does anyone have any information on what the different StagingCode values signify and why different packages have different codes?

  • Custom Import settings (MP3) not working?

    I downloaded itunes today having read the help guides that I could d/l files in MP3 format. I changed the custom import settings as per the help guide and purchased music - only to find the downloads are still in m4p format & as such are no good for my mp3 player.
    Right clicking & converting doesn't work as they are protected.
    I am hoping this is just an error on the custom set up on my part, but reading this forum I did read about protected and Plus purchases, which I did not see in the help guide before I bought the music.
    So, my question is: can the protected files be downloaded with the customized MP3 encoder settings or am I completely limited to Plus purchases?
    Thanks!

    The import setting have no effect on store downloads, all iTunes store downloads are AAC (MP4). The import settings are used to convert the songs imported from CD or to convert unprotected songs in iTunes, not for choosing a format to download song from the store.
    You can't convert standard iTunes copy protected songs, only the iTunes Plus purchases can be directly converted to another format. Where possible if you need to convert you should go for iTunes Plus tracks. The only thing you can do with standard songs apart from playing them in iTunes or on an iPod/iPhone is burn them to Audio CD. You can use that CD just like any regular one. If you need songs that will play on a non Apple player you'd be better looking around for other stores that provide unprotected MP3 downloads.

  • Duplicate command is not working for custom importer

    Hi All,
    I am working on a custom importer plugin. Basic features are working fine, but, I'm facing an issue with Duplicate functionality.
    I added a new custom importer clip to project and created a duplicate of that clip (by right clicking the clip in Project window and selecting Duplicate from pop-up menu). Then I added both clip instances to timeline. Now, if I change properties of one clip instance it reflects in both clips. I noticed that both ClipIds are same and they are referring to same media path. I also observed the same behavior in SDK_Custom_importer sample. But, built in 'Color Matte' and 'Title' clips works fine.
    As per my understanding, Duplicate command should create a new clip from existing clip and new clip should be independent of original clip after creation.
    How to fix this issue? Is there any selector that I should handle to support Duplicate functionality?
    Thanks & Regards,
    Chandan

    Hi Chandan,
    The Color Matte and Title clips are not quite the same as your custom importer example.  Those are synthetic clips, without a file reference on disk.  If you exported a title to a file on disk, and then reimported it, and duplicated it so that there were two clips in the Project panel that reference the same file on disk, I think you would have the same behavior as what you're seeing with your custom importer.  Duplicate doesn't create a new file on disk.  The user would need to do that manually, and then import the new file.
    Regards,
    Zac

  • Custom importer

    We have a custom importer plugin for premiere CS6.
    We dont save a custom file on disk, but we render the frames demanded by Premiere framework on the fly and return the data in imImportImageRec in imImportImage call.
    1) The sequence when we create a new instance goes like
    imGetPrefs8   - we show a custom entry dialog here - store the result in a global variable which is accessed in imGetInfo8.
    imGetInfo8     - with private data pointer (where we store pointer to our custom class which actually renders the data( based on the variable set in imGetPrefs8 )
    imImportImage - with private data pointer filled in imGetInfo8 - render here based on the frame number received using the private data.
    2) And when we save and load the instance we get a call to imGetInfo8  with the private data( based on which  we create a instance of our custom class to render data)
    and subsequent calls to imImportImage with the private data filled in imGetInfo8.
    3) Now the case comes when we modify the existing instance by double clicking it.
    We get a call to imGetPrefs8  but not  imGetInfo8.
    but we are not able to modify the private data as per user changes done in imGetPrefs8 , as we dont get a call to imGetInfo8.
    So the subsequent calls to imImportImage work with the old private data, hence the changes dont reflect.
    How should we go about it?
    Guide.

    in imGetPrefs8 why don't you check for privateInstance == NULL then create as needed.
    If != NULL call your modification function.
    imGetInfo89 should only populate the selector struct with info from the private data (already allocated by imGetPrefs8).
    I've never looked at the synthetic importer example but this is exactly what you're doing so that should be your starting code to hack on.

  • "No active legal regulations found for country US "  while trying to create the Customs Import Declaration

    Dear Experts,
    As part of creating Customs Import Declaration manually, when I selected the FTO and try to use create button I am getting error message .
    Can you please help me in this regard .
    No active legal regulations found for country US
    Ram

    Hi Ram,
    As the error message straight away tells , you need to activate Legal Regulation for Customs Management ( in standard case, it will be ACE) for US country through the below path:
    SPRO-->SAP Global Trade Services-->Customs Management-->Activate Leagl Regulation for Customs Management at Country/Country Group level
    In case of any further queries, please let me know it.
    Regards,
    Aman

  • Custom Importer Issue

    Hi All,
    I am using Premiere Pro CS4 SDK and Premiere Pro CS4 trial version to create a custom importer. I tried SDK_Custom_Importer sample and my issue is -
    When I select File->New->SDK Custom Import... the .sdkc file created during imGetPrefs8 is not listed in the Project panel. But the entry shows up if I select the same file from File->Import dialog.
    How do I make sure the file is added even when I select File->New->SDK Custom Import?
    Thanks,
    Chandan

    Hi Chandan,
    The Color Matte and Title clips are not quite the same as your custom importer example.  Those are synthetic clips, without a file reference on disk.  If you exported a title to a file on disk, and then reimported it, and duplicated it so that there were two clips in the Project panel that reference the same file on disk, I think you would have the same behavior as what you're seeing with your custom importer.  Duplicate doesn't create a new file on disk.  The user would need to do that manually, and then import the new file.
    Regards,
    Zac

  • Simple logic group to operate prior to custom import script?

    Hi all,
    Thanks for taking the time to read my question. I will gladly mark this thread as helpful or answered if you can help me. I'm a novice at FDM so please bear with.
    I have a custom import script that assigns ICP None to a specific account (overriding any ICP detail). However, now I need the ICP detail for that account in a second statistical account. I setup a simple logic group to create the logic account that I can map to the statistical but then realized that the import script runs prior to the logic group so I lose all ICP detail in the logic account as well.
    Is there a way to run the logic group prior to import script or is there a better way to accomplish what I'm trying to do?
    I'm not sure how critical this is but I'm using FDM v11.1.1.3.01 adapter 11x-G5-C
    Edited by: user4591089 on Aug 17, 2011 2:10 PM
    Edited by: user4591089 on Aug 17, 2011 2:50 PM

    Do the following:
    1) Remove the custom import script.
    2) Create a complex logic account and override the ICP dimension in the Group By Column with the Value [ICP None]. This will then be what is diplayed on the import screen for this logic account.
    3) Map the original source as the statistical account and the logic account as appropriate
    Edited by: SH on Aug 18, 2011 9:48 AM

  • Sequence# vs. Total# vs. Import# in Custom import template

    Does anyone know the difference between these in the custom import naming template?

    Try this:
    Sales:=
    SUM( 'PTV FLAT HITLIST'[SALES THS#EUR] )
    PY Sales:=
    CALCULATE(
    [Sales]
    , FILTER( ALL( PERIOD[FISCAL YEAR] )
    , PERIOD[FISCAL YEAR] = MAX( PERIOD[FISCAL YEAR] ) - 1
    Sales vs PY Sales:=
    [Sales] / [PY Sales]
    This will work if you put PERIOD[MONTH NUMBER] on the rows under PERIOD[FISCAL YEAR].
    If you must keep PERIOD[DATE] on the rows, then you'll need to handle this a little differently. PERIOD[DATE]  uniquely identifies a month. This means that with the measures I have suggested above, the filter context will not be cleared from PERIOD[DATE]
    and so the filter context of CALCULATE() will be an impossible condition:
    On Row Label 2014-03, the filter context will be PERIOD[DATE] = 2014-03 && PERIOD[FISCAL YEAR] = 2013.
    If you must keep PERIOD[DATE] as your rowfilter, try this:
    Sales:=
    SUM( 'PTV FLAT HITLIST'[SALES THS#EUR] )
    PY Yr Sales:=
    CALCULATE( [Sales]
    , FILTER( ALL( PERIOD[FISCAL YEAR] )
    , PERIOD[FISCAL YEAR] = MAX( PERIOD[FISCAL YEAR] ) - 1
    PY Mo Sales:=
    CALCULATE( [Sales]
    , FILTER( ALL( PERIOD )
    , PERIOD[FISCAL YEAR] = MAX( PERIOD[FISCAL YEAR] ) - 1
    && PERIOD[MONTH NUMBER] = MAX( PERIOD[MONTH NUMBER] )
    PY Sales:=
    IF( ISFILTERED( PERIOD[DATE] )
    , [PY Mo Sales]
    , [PY Yr Sales]
    Sales vs PY Sales:=
    [Sales] / [PY Sales]

  • Custom Importing Setting

    **Custom Importing Setting**
    I have discovered the Custom Importing settings in the iTunes Advanced Preferences. I have some questions/comments and would like some feedback if possible
    Stereo Bit Rate - I think I will set this at 192 kbps for the better quality
    Sample Rate - I think I will set this to 44.1k, which is the CD standard, but I am wondering what rate is used for the "Auto" setting? It doesn't display when you select this setting?
    Channels - Again, I think I will set this at "Stereo" for better quality but I am also wondering what "Auto" is?...stereo or mono?
    Stereo Mode - I don't think I want to select "Joint Stereo" because from the research I've read on that, it is lossy and sort of approximates the stereo field but is not true stereo. So I assume the "Normal" setting is just regular stereo?
    Filter Frequencies Under 10Hz - the purest in me does NOT want to select this option but can the human ear even detect that low of a frequency?...then again, we can probably feel it more than we hear it, which is still important in a lot of rock, rap and pop music.
    any thoughts, comments, advice?...

    That seems to be exactly the same as the "Highest" setting (192kbps). If quality is most important, you should choose AAC instead of mp3. A 192kbps AAC VBR file will sound a lot better than 192kbps mp3.

  • Can no longer change bit rate in AAC custom import settings

    I've been re-ripping all my CDs at the new higher bit rate. My import settings were AAC Encoder -- custom, originally set to 256 kbps, VBR, and auto for the other two settings. However, some CDs I wanted at a lower setting, so I would go change the bit rate to either 192 or 224 (just so I'd have more room on my ipod) and there wouldn't be a problem. But now it's stuck -- the pop-up box no longer opens when I choose import settings, AAC Encoder, Custom, so I can't change the bit rate or anything else, and it's stuck on 224 kbps. I can still change bit rate and other settings in the custom menus for MP3, WAV, etc., just not AAC. A repair install of iTunes did not fix the problem.

    Hi, Ed. I am running iTunes 9.0.3.15. When I click custom, the settings description in the details box display what they were before this thing happened = 112 kbps (mono)/224 kbps (stereo), VBR, optimized for MMX/SSE2. The pop-up dialogue box that used to appear (where you could choose the specific bit rate from the drop down menu) does not appear at all.
    However, when I choose anything other than AAC Encoder, and then pick custom, the pop-up box appears and I can choose the bit rate and adjust the other settings as usual. It's just not happening for AAC Encoder anymore. Since the total un-install (following Apple's specified order) and reinstall didn't work, I'm baffled how to fix this .... (If it makes a difference, I changed the bit rate in the custom box while a CD was being burned...Apparently that was stupid, but I had done it previously without incident.) Thanks.

  • What exactly is "Joint stereo" in the MP3 custom import settings?

    Hi
    I want to optimize the way I import my cds on itunes and this is the only custom setting that I don't really understand. I read he help guide bit that refers to this and I'm not understanding it fully.
    Does it change in any way the left and right channel are delivered to the speakers/earphones from the way they were on the original cd at all? If I leave it to normal, what's different?
    Thanks

    Quote:
    "Joint Stereo is a neat mathematical technique which is used to enhance the quality of compressed digital audio. It generally tends to be associated with the most popular format of audio compression - mp3, but it has also been incorporated into several other formats"
    "Joint stereo is a method to save additional space while retaining a stereo signal, exploiting the fact that most music contains relatively little difference between the left and right audio channels"
    You can read more at these links:
    Joint Stereo - The Myths and the Realities
    What is Joint Stereo?

  • Cannot change custom import settings in iTunes on aac

    For some strange reason, my ability to change the AAC import settings in Itunes has very recently been eliminated. when i go to custom AAC it will not allow the drop down any longer? I had this ability!
    using Itunes 10.5.3
    Lion OSX 10.7.3
    All updates are curent

    Ooops........
    My Bad, correct, posted in Itunes for windows by mistake. thanks.
    Answer does not deal with my issue anyways thanks for the help.
    wil repost in correct area.

  • There is no 'Position' field on the advanced Customer Import template - how do i add this?

    Hi All ,
    I'm sure im not the first one to encounter this issue but i dont see another question similar .
    My client would like to also add the customer's 'Position' to the CRM record when they upload the spreadsheet. IE Bob Smith, Managing Director....
    There is no column for 'Position' - How would you suggest going about doing this?
    Thanks .

    Hi,
    If you have generated this field via Admin > CRM > Extend CRM Database, then when going to CRM > Customers > Import Contacts (Advanced), near the bottom of the page, you'll see a drop-down ("Choose CRM Form if you wish to import custom information for contacts") from where you can choose to include the respective field in the import template.
    Kind Regards,
    Alex

Maybe you are looking for

  • Jabber Client softphone is "No Connected"

    Hi, I am trying to setup a lab for cisco partner testing. I created Collab 10.5 topology with cucm & cups 10.5. I am running out of ideas of what could be wrong. My jabber client for windows works with deskphone but it does not work with it's softpho

  • Formula based on Display data (summarized data)

    PrvYrAmt--PrvYrQty-- AvgPrice----CurYrQty--CurYrAmt (PrvYrAmt---- (CurYrQty * / PrvYrQty)---- Prv Yr AvgPrice) 150 - 10 - $15--15-- 225 100 - 20 - $5  - 10---- 50 Total  - $10 - 25---- 250(sum 275) When I try to create a Formula with CurYrAmt I need

  • Share iphoto library with 2 users

    Just updated to Lion v10.7 and I'm also running the latest version of iPhoto v9.1.5. I have 2 user accounts on the same mac min, with the iPhoto library located under users/shared folder. Assuming you only open one instance of iPhoto, all seems fine.

  • Kernal panics won't let me start up the labtop

    Whenever I try to start up my mac now it will try to start then shop the Kernal "have to restart computer" I tryed restarting Pram and other ways of restarting the computer but it just keeps showing the kernal. I cant try disk utility because i had a

  • Portal Error 500

    I am getting the below error in portal while click on "Employee self service"              " An expception occured while processing your request. Send the exception ID to your portal administrator.              Exception ID:01:22_04/04/11/11_0001_106