# Problem with info.lua files??



## Katemac (Sep 11, 2018)

I wasn’t sure which forum (LRCC or LR Classic) to post this query on as it involves using both apps in my import workflow.  I am having trouble with info.lua files populating my folders within LR.  I import my iPhone photos via LRCC app to the cloud and then they sync with LR Classic.  Once in classic I move my iPhone photos into my normal organization system and out of the import folder. But what remains in the original import folder is this info.lua file.  So it looks like those folders are empty within the LR hierarchy (they say 0 files in there).  Usually I would tell LR to remove that folder from within the catalog and everything would be fine.  But since that info.lua file is in each of the date folders they are not deleted on my hard drives.  I went and saw all the folders (with the original dates from import) that each have one info.lua file within them.  This is making a mess of my folder system.  Help!  I never had this before.  I am using LR Classic CC 7.4, LR CC 3.11, Mac Sierra 10.12.6
Thanks in advance for any assistance.


----------



## johnbeardy (Sep 11, 2018)

Yes, it is messy. Classic's Sync adds them automatically, and it really should delete them when you remove a folder which hasn't any images in it.  You can safely delete those files and the folders, but you have to do so in Explorer/Finder.

John


----------



## Katemac (Sep 11, 2018)

Thanks John.  At least now I know I can delete away.  I was afraid to do that as I thought maybe it’s how my iPhone knows to not reimport photos from my phone once they are imported.  But glad to know this isn’t the case.


----------



## johnbeardy (Sep 12, 2018)

I find this issue such a time-waster that I wrote this script. Select the folders in Folders panel, run the script and it deletes any info.lua files. You can then delete the folders in LR normally, which then means they're gone in Finder/Explorer too.

John


```
--[[
Copies smart collections to dumb ones

SETUP INSTRUCTIONS

Open the file in TextEdit and change the value myNewPrefix below
Temporarily save this file onto your desktop and call it "YOURFILENAME.lua".

Now you need to create a scripts folder:
    In Lightroom, choose Lightroom > Preferences (Mac OS) or Edit > Preferences (Windows).
    Choose the Preset tab and select Show Lightroom Presets folder.
    Create a folder in the Lightroom folder called Scripts.
    Copy the "YOURFILENAME.lua" script into the Scripts folder.
    Quit and reopen Lightroom. 
You should now see a little scripts menu to the right of the Help menu. It has a single item Title case keywords.
--]]

if MAC_ENV then SEP = '/' else SEP = '\\' end

--[[
Don't change anything after here
--]]
LrView = import 'LrView'
LrDialogs = import 'LrDialogs'
LrApplication = import 'LrApplication'
catalog = LrApplication.activeCatalog()
LrTasks = import 'LrTasks'
LrFileUtils = import 'LrFileUtils'
LrFunctionContext = import 'LrFunctionContext'

if LrApplication.versionTable()['major'] <5 then
    LrDialogs.message( "Oops - must be run in Lr5 or later" , "collection:getSearchDescription() is a feature introduced in Lr5")
    else
    
    LrTasks.startAsyncTask( function()    
    catalog:withWriteAccessDo( "Duplicate smart collections", function()
        folder = catalog:getActiveSources( )
        for i, folder in ipairs(folder) do                
            if folder:getPath() ~= nil then
            path = folder:getPath() .. SEP .. 'info.lua'            
            if LrFileUtils.exists(path) == 'file' then
                LrFileUtils.delete( path )
                end
            end
        end
        LrDialogs.showBezel( "Now try deleting the folders in Lr")
    end)
    end)
end
```


----------



## Katemac (Sep 12, 2018)

Thank you John.  I'll give this a look when I'm home later this evening and see if I can get it to work.  I appreciate your time in doing this.


----------



## johnbeardy (Sep 12, 2018)

The script was in fact written a while ago for myself.


----------

