Find folders & subfolders containing only '.DS_Store'

Through Terminal or otherwise, how can I find all subfolders in a folder/directory containing only the item ‘.DS_Store’?
I want to remove these.  I’ve tried deleting .DS_Store through different Terminal commands and then using Spotlight to find files containing zero (and less than 1) items and have located some, but not all.
Thank you!

I'm just keeping things factual, I'm sorry if you took it as a negative comment.  It is true that the OP wanted to remove (otherwise) empty folders.
So in my ~/Downloads/ folder, I do not want to leave all the folders there  I download files for work daily, and they are numerous in number and usually large.  I have a script which deletes files accessed over 60 days ago, and empty folders.  I have thousands of folders that have had their contents removed, but the directory is still cluttered.  Eventually you actually can run out of inodes on a disk, so it's fine to delete folders in this case.
This thread helped me figure out what I needed and it now works as I hoped. 
Script for reference:
#~/Library/LaunchAgents/com.myname.reaper.plist calls this script
#using launchd to run 1x a day at 10:00
#`
#!/bin/sh
# Finds all files within ~/Cases/ whose "last accessed"
# dates are more than 120 days ago and moves them to the trash.
# Finds all files within ~/Downloads/ whose "last accessed"
# dates are more than 60 days ago and moves them to the trash.
date
echo $TIME
find ~/Documents/Cases/ -atime +120 -print
find ~/Documents/Cases/ -empty -print
find ~/Downloads/ -atime +60 -print
find ~/Downloads/ -empty -print
find ~/Downloads/ -type f -name ".DS_Store" -print
find ~/Documents/Cases/ -atime +120 -exec mv {} ~/.Trash/ \; ;
find ~/Documents/Cases/ -empty -exec mv {} ~/.Trash/ \; ;
find ~/Downloads/ -atime +60 -exec mv {} ~/.Trash/ \; ;
find ~/Downloads/ -type f -name ".DS_Store" -exec mv {} ~/.Trash/ \; ;
find ~/Downloads/ -empty -exec mv {} ~/.Trash/ \; ;
echo __________________________________________
echo $TIME
say -v Zarvox "reaper complete"

Similar Messages

  • How do I move folders with subfolders (containing pdf files) from my pc to ipad 3 to use in adobe reader

    How do I move folders with subfolders (containing pdf files) from my pc to ipad 3 to use in adobe reader

    You need to connect the ipad to the computer and open itunes.
    Open the ipad and go into settings, icloud. Tap on "Documents and Data" and turn that on to sync to icloud.
    Now go back into itunes and it should pick up your ipad already and tap on the ipad connection. There will pop up some taps on the center screen for sync options. Go thru each one (summary, info, apps, music, tv shows, podcasts, itunesU, books and photos).....you want to click on "Books".
    To the left click the arrow next to the ipad under Devices.
    The arrow will point down and open the sub menu, click on the "Books" sub menu here. You will see in the center window current books, PDF currently on the ipad.
    Next go to the top and click on "File"  (file, edit, view, controls, store, advanced, help) and click on "add folder to library"...... it will bring up your computer file system in a seperate window. File the folder your looking for and add it. This should get the folder set up to sync onto ipad thru itunes.
    For additional ease in doing things on the middle window of itunes click back on summary, scroll a bit and you will see "Backup", click on "Backup to icloud". Then under "Options", check "Sync with this ipad over WiFi".
    This will allow you to wirelessly sync your itunes and your ipad without having the ipad connected to the computer with a cable. You just have to be on the same wireless network.
    If in itunes you add something like a pdf or photo, when your on your ipad open the Ibooks or Iphoto app and it wull update the file system to match your itunes account. The sync with with anything you do in itunes and it works the other way around also. If you save files, photos, books on the ipad, using the ipad (app store purchases, games, books)....the ipad will update to itunes next time your on the same network.
    FYI - both the ipad and the computer have to be on.
    Itunes updates (changes you make thru itunes), does not need itunes to be open for update content to update to the ipad. This is because it updates to the cloud.
    Updates from the ipad to itunes will need itunes open on the computer. So it can sync with the cloud info.

  • I am just learning Lightroom 5. Noticed very recently that 'Photo is Missing' has come up against virtually all my files over all my folders/subfolders. That said, using Finder on my MAC I can see thumnails of ALL my images which sit within my Pictures Fo

    I am just learning Lightroom 5. Noticed very recently that 'Photo is Missing' has come up against virtually all my files over all my folders/subfolders. That said, using Finder on my MAC I can see thumnails of ALL my images which sit within my Pictures Folder. Equallly on my back-up on the Mac's Time Machine all versions of same images are present. Any solutions?

    It means that the photos have been moved or renamed or deleted outside of Lightroom. (Hint: don't do that)
    To fix the problem, please follow these instructions:
    http://www.computer-darkroom.com/lr2_find_folder/find-folder.htm

  • Empty Finder folders don't display correctly in Mountain Lion

    Anyone else experienced this or have a solution?
    I upgraded from Lion to Mountain Lion last night (on a late 2010 MacBook Air). Everything went smoothly. But I have an irritating problem with Finder.
    When opening folders (from sidebar icons or from main window icons), if the folder contains documents or subfolders Finder displays the contents of the folder correctly.
    However if the folder is empty, Finder displays either the contents of the last folder that I looked at that did contain documents, or a strange jumbled mix of icons. These can be selected, but cannot be deleted, opened, viewed, etc.
    So, for example, if I open my Documents folder (which has a lot of things in it), Finder displays the contents correctly.
    If I then open my Downloads folder (which is empty), Finder either displays the contents of the Documents folder, or a strange mix of icons.
    Any suggestions? The only workaround I've found is to set the empty folders to a different type of view (e.g. the detailed list).

    I have a 2008 iMac and a 2012 Retina MacBook Pro. Neither machine has been hacked and neither machine has been modified from the way it came from the factor. The only thing my vanilla-flavored Macs have in common is Mountain Lion, which runs fine otherwise.
    If I create an empty folder and attempt to open it, the Finder window has the same contents but the title of the empty folder. At some point there is no way to get out of the empty folder (except by opening a new Finder window). If you are outside the empty folder, at some point it cannot be deselected or deleted. (It can be deleted in the Terminal with the rmdir command.) Restarting FInder doesn't seem to help. You can only remove the folder in the Terminal.
    If you create a new folder and immediately put something into it, it behaves normally, but if you remove that item from the folder, the weird behavior returns. If an empty folder has ever contained anything, you can't delete it in Terminal because it now contains a .DS_Store file. You can delete that file and then remove the foldler.
    If you create an empty folder on the desktop, it will behave as expected. If you move that empty folder to some other place without putting anything into it, it has the weird behavior in the new location.
    Some developer at Apple is really sweating bullets right now.

  • Export Aperture library objects to Finder folders

    Inspired by the posted message by user http://discussions.apple.com/profile.jspa?userID=616539 I wrote a script that will do the following:
    1. Sync Folders/SubFolders/Albums/Projects..etc hierarchy tree from Aperture to a Finder folders tree
    2. At run-time the script will creates/append to a log file under (home directory)\Library\Logs\AppleScriptExportApertureLibrary.log
    3. Exports all projects images versions with embedded metadata
    4. Create a file system "hard links" for each photo in the respective Albums pointing to the project folder location in order to preserve space.
    5. Compare modification date on the image files and modification date within Aperture and export only modified images in order to save time for a full sync/export.
    6. In interactive mode you can select Export Folder location, Aperture Library location and Projects List (project list will contain project name and internal aperture project id).
    7. In non-interactive (from command line) mode there are two arguments:
    7a. "quiet" - exports all projects
    7b. "quiet" "Project Information" - export only certain projects. the project information can be found in the log file.
    8. Remove any images or folders from Finder export directory that do not exist in Aperture database any more.
    Hopefully this would help anyone who is looking to export from Aperture on a regular basis. I am not sure how it will handle large amount of photos. I tested it with 3k+ photos.
    Please note that you use this script at your own risk.
    Here is the script code:
    global theFoldersTree_G
    global theLibraryPath_G
    global theProcessedProjects_G
    global theSelectedProjects_G
    global theAllAlbums_G
    global theScriptName_G
    global Sqlite_G
    global ApertureLibrary_G
    global numExports_G
    on run argv
    set Sqlite_G to "/usr/bin/sqlite3"
    set ApertureLibraryPath to POSIX path of (path to home folder) & "Pictures/"
    set ApertureLibrary_G to ApertureLibraryPath & "Aperture Library.aplibrary/Aperture.aplib/Library.apdb"
    set exportFolder to POSIX path of (path to home folder) & "Pictures/Aperture Exports/"
    set theScriptName_G to "ExportApertureLibrary"
    set theSelectedProjects_G to "ALL PROJECTS"
    set theFoldersTree_G to {}
    set theProcessedProjects_G to {}
    set theAllAlbums_G to {}
    set numExports_G to 0
    logEvent("Started")
    set theArgv1 to {}
    set theArgv2 to {}
    if (count of argv) ≥ 1 then
    set theArgv1 to item 1 of argv
    end if
    if (count of argv) = 2 then
    set theArgv2 to item 2 of argv
    end if
    logEvent("Passed ARGV 1: " & theArgv1)
    logEvent("Passed ARGV 2: " & theArgv2)
    if theArgv1 is not equal to "quiet" then
    set theFile to (choose file with prompt "Please choose the Aperture Library file" default location POSIX file ApertureLibraryPath) as string
    set ApertureLibrary_G to POSIX path of theFile & "Aperture.aplib/Library.apdb"
    set exportFolder to POSIX path of (choose folder with prompt "Please choose the export folder" default location POSIX file exportFolder) as string
    end if
    logEvent("ApertureLibrary_G path is set to: " & ApertureLibrary_G)
    logEvent("exportFolder path is set to: " & exportFolder)
    try
    tell application "Aperture"
    logEvent("Getting list of project path information...") of me
    set SqlStatement to "
    select replace(A.ZLIBRARYRELATIVEPATH,'.approject',''),A.ZUUID
    from ZRKFOLDER AS A
    WHERE A.ZFOLDERTYPE=2
    ORDER BY A.ZNAME"
    set SQLProjectUUIDPath to DB_execute(SqlStatement) of me
    set theProjectsOptions to SQLProjectUUIDPath as list
    set end of theProjectsOptions to "ALL PROJECTS"
    logEvent("Projects list: " & theProjectsOptions as string) of me
    if theArgv1 is not equal to "quiet" then
    set theSelectedProjects_G to choose from list SQLProjectUUIDPath with prompt "Please choose a project(s):"
    end if
    if theArgv2 is not equal to {} then
    set theSelectedProjects_G to theArgv2
    end if
    logEvent("The selected projects : " & theSelectedProjects_G as string) of me
    logEvent("Getting list of libraries...") of me
    set theLibraryList to every library
    logEvent("Found " & (count of theLibraryList) & " libraries") of me
    repeat with theLibrary in theLibraryList
    set theLibraryName to name of theLibrary
    logEvent("Processing library: " & theLibraryName) of me
    set LibraryFolders to {}
    set theProcessedProjects_G to {}
    tell application "Finder"
    if not (exists (POSIX file (exportFolder & theLibraryName) of me)) then
    logEvent("creating new folder " & theLibraryName & " at " & exportFolder) of me
    make new folder at (POSIX file exportFolder of me) with properties {name:theLibraryName}
    end if
    end tell
    set theLibraryPath_G to exportFolder & theLibraryName & "/"
    logEvent("Getting list of folders...") of me
    set theFolderList to every folder of library id (id of theLibrary)
    logEvent("Found " & (count of theFolderList) & " folders") of me
    set theRootFolderList to {}
    if theFolderList is not equal to {} then
    processFoldersTree(0, theFolderList) of me
    repeat with theFolder in theFolderList
    if (id of theFolder) is not in theFoldersTree_G as string then
    logEvent("Found root folder : " & (name of theFolder) as string) of me
    set end of theRootFolderList to theFolder
    set end of LibraryFolders to (name of theFolder)
    end if
    end repeat
    end if
    if theRootFolderList is not equal to {} then
    processFolders(theRootFolderList, theLibraryPath_G, "projects") of me
    processFolders(theRootFolderList, theLibraryPath_G, "albums") of me
    else
    set theProjectList to every project of library id (id of theLibrary)
    set end of LibraryFolders to processProjects(theProjectList, theLibraryPath_G, "projects") of me as list
    processProjects(theProjectList, theLibraryPath_G, "albums") of me
    end if
    logEvent("Getting list of projects...") of me
    set theProjectList to every project of library id (id of theLibrary)
    logEvent("Found " & (count of theProjectList) & " projects") of me
    logEvent("Getting list of albums...") of me
    set theAlbumList to every album of library id (id of theLibrary)
    logEvent("Found " & (count of theAlbumList) & " albums") of me
    set theRootProjectList to {}
    if theProjectList is not equal to {} then
    repeat with theProject in theProjectList
    if (id of theProject) is not in theProcessedProjects_G as string then
    logEvent("Found root project : " & (name of theProject) as string) of me
    set end of theRootProjectList to theProject
    set end of LibraryFolders to (name of theProject)
    end if
    end repeat
    end if
    set theRootAlbumList to {}
    if theAlbumList is not equal to {} then
    processAlbumsTree(theProjectList, theFolderList) of me
    set theRootAlbumList to {}
    repeat with theAlbum in theAlbumList
    if (id of theAlbum) is not in theAllAlbums_G as string then
    logEvent("Found root album : " & (name of theAlbum) as string) of me
    set end of theRootAlbumList to theAlbum
    set end of LibraryFolders to (name of theAlbum)
    end if
    end repeat
    end if
    if theRootProjectList is equal to {} then
    processAlbums(theRootAlbumList, theLibraryPath_G, "albums") of me
    else
    processProjects(theRootProjectList, theLibraryPath_G, "projects") of me
    processProjects(theRootProjectList, theLibraryPath_G, "albums") of me
    if theRootAlbumList is not equal to {} then
    processAlbums(theRootAlbumList, theLibraryPath_G, "albums") of me
    end if
    end if
    cleanup(LibraryFolders, theLibraryPath_G, "all") of me
    end repeat
    logEvent("total exports : " & numExports_G) of me
    if theArgv1 is not equal to "quiet" then
    display dialog "Total image exports : " & numExports_G buttons {"OK"} with title "Aperture Library Export" with icon note
    end if
    end tell
    on error s number i partial result p from f to t
    set s to "Error: " & s
    logEvent(quoted form of (s))
    if theArgv1 is not equal to "quiet" then
    display dialog "ERROR : " & s buttons {"OK"} with title "Aperture Library Export" with icon note
    end if
    end try
    end run
    on cleanup(theObjects, thePath, theSelection)
    logEvent("Cleaning export folders...") of me
    logEvent("# Objects: " & (count of theObjects)) of me
    logEvent("Export Folder: " & (thePath as string))
    tell application "Finder"
    logEvent("Getting list of folders...") of me
    set theFolderList to every folder in folder (POSIX file thePath of me)
    logEvent("Found " & (count of theFolderList) & " folders") of me
    logEvent("Getting list of files...") of me
    set theFileList to every file in folder (POSIX file thePath of me)
    logEvent("Found " & (count of theFileList) & " files") of me
    repeat with theFolder in theFolderList
    set theFolderName to name of theFolder
    if theFolderName is not in theObjects as string then
    logEvent("Moving folder " & theFolder & " to trash...") of me
    move theFolder to trash
    end if
    end repeat
    if theSelection is not equal to "folder" then
    repeat with theFile in theFileList
    set theFileName to name of theFile
    if theFileName is not in theObjects as string then
    logEvent("Moving file " & theFile & " to trash...") of me
    move theFile to trash
    end if
    end repeat
    end if
    end tell
    logEvent("Cleaning completed...") of me
    end cleanup
    on logEvent(logMessage)
    set theLine to quoted form of (((current date) as string) ¬
    & " : " & logMessage)
    do shell script "echo " & theLine & ¬
    " >> ~/Library/Logs/AppleScript" & theScriptName_G & ".log"
    end logEvent
    on DB_lookupProjectPath(puuid)
    set SqlStatement to "
    select replace(rtrim(ZLIBRARYRELATIVEPATH,'.approject'),'/',':' )
    from ZRKFOLDER
    where
    ZUUID ='" & puuid & "'"
    set SqlRecords to DB_execute(SqlStatement)
    return DB_record(SqlRecords, 1, 1)
    end DB_lookupProjectPath
    on processFolders(theFoldersList, theFolderPath, processOrder)
    logEvent("processFolders... : " & theFolderPath) of me
    set arrayOfFolders to {}
    tell application "Aperture"
    set theCount to count of theFoldersList
    set theCounter to 1
    repeat with theFolder in theFoldersList
    set foldersOfFolder to {}
    set theFolderName to name of theFolder
    logEvent("Processing folder : " & theFolderName & " (" & theCounter & "/" & theCount & ")") of me
    set theCounter to theCounter + 1
    set end of arrayOfFolders to theFolderName
    tell application "Finder"
    if not (exists (POSIX file (theFolderPath & theFolderName) of me)) then
    logEvent("creating new folder " & theFolderName & " at " & theFolderPath) of me
    make new folder at (POSIX file theFolderPath of me) with properties {name:theFolderName}
    end if
    end tell
    logEvent("Getting list of album...") of me
    set theAlbumsListOfFolder to every album of folder id (id of theFolder)
    logEvent("Found " & (count of theAlbumsListOfFolder) & " albums") of me
    logEvent("Getting list of folder...") of me
    set theFolderListOfFolder to every folder of folder id (id of theFolder)
    logEvent("Found " & (count of theFolderListOfFolder) & " folders") of me
    logEvent("Getting list of project...") of me
    set theProjectsListOfFolder to every project of folder id (id of theFolder)
    logEvent("Found " & (count of theProjectsListOfFolder) & " projects") of me
    if theProjectsListOfFolder is not equal to {} then
    set end of foldersOfFolder to processProjects(theProjectsListOfFolder, (theFolderPath & theFolderName & "/"), processOrder) of me as list
    end if
    if theFolderListOfFolder is equal to {} then
    set end of foldersOfFolder to processAlbums(theAlbumsListOfFolder, (theFolderPath & theFolderName & "/"), processOrder) of me as list
    else
    if theAlbumsListOfFolder is not equal to {} then
    set end of foldersOfFolder to processAlbums(theAlbumsListOfFolder, (theFolderPath & theFolderName & "/"), processOrder) of me as list
    end if
    set end of foldersOfFolder to processFolders(theFolderListOfFolder, (theFolderPath & theFolderName & ":"), processOrder) of me as list
    end if
    cleanup(foldersOfFolder, (theFolderPath & theFolderName & "/"), "all") of me
    end repeat
    end tell
    logEvent("processFolders completed...") of me
    return arrayOfFolders
    end processFolders
    on processFoldersTree(theParent, theFoldersList)
    logEvent("processFoldersTree...") of me
    tell application "Aperture"
    repeat with theFolder in theFoldersList
    if theParent is not 0 then
    set end of theFoldersTree_G to (id of theFolder)
    end if
    set theFolderListOfFolder to every folder of folder id (id of theFolder)
    if theFolderListOfFolder is not equal to {} then
    processFoldersTree((id of theFolder), theFolderListOfFolder) of me
    end if
    end repeat
    end tell
    logEvent("processFoldersTree completed...") of me
    end processFoldersTree
    on processAlbumsTree(theProjectsList, theFoldersList)
    logEvent("processAlbumsTree...") of me
    set theAllAlbums_G to {}
    tell application "Aperture"
    repeat with theProject in theProjectsList
    repeat with theAlbum in (every album of project id (id of theProject))
    set end of theAllAlbums_G to (id of theAlbum)
    end repeat
    end repeat
    repeat with theProject in theProjectsList
    repeat with theAlbum in (every album of every subfolder of project id (id of theProject))
    set end of theAllAlbums_G to (id of theAlbum)
    end repeat
    end repeat
    repeat with theFolder in theFoldersList
    repeat with theAlbum in (every album of folder id (id of theFolder))
    set end of theAllAlbums_G to (id of theAlbum)
    end repeat
    end repeat
    end tell
    logEvent("processAlbumsTree completed...") of me
    end processAlbumsTree
    on DB_lookupImageInfo(puuid)
    set SqlStatement to "
    SELECT replace(A.ZLIBRARYRELATIVEPATH,'.approject',''),strftime('%m/%d/%Y %H:%M:%S',datetime(B.ZDATELASTSAVEDINDATABASE, 'unixepoch', '+31 years','localtime'))
    from ZRKFOLDER AS A,ZRKVERSION AS B
    where
    B.ZPROJECTUUID = A.ZUUID AND
    B.ZUUID ='" & puuid & "'"
    set SqlRecords to DB_execute(SqlStatement)
    return {theImagePath:DB_record(SqlRecords, 1, 1), theImageDate:DB_record(SqlRecords, 1, 2)}
    end DB_lookupImageInfo
    on processProjects(theProjectsList, theProjectPath, processOrder)
    logEvent("processProjects... : " & theProjectPath) of me
    logEvent("processOrder: " & processOrder) of me
    set arrayOfProjects to {}
    tell application "Aperture"
    set theCount to count of theProjectsList
    set theCounter to 1
    repeat with theProject in theProjectsList
    set ProjectFolders to {}
    set theProjectName to name of theProject
    set end of arrayOfProjects to theProjectName
    set theContinue to 0
    if "ALL PROJECTS" is not in theSelectedProjects_G as string then
    if (id of theProject) is not in theSelectedProjects_G as string then
    logEvent("Skipping project: " & theProjectName) of me
    set theContinue to 1
    end if
    end if
    if theContinue = 0 then
    -- set theProjectPath to theProjectPath & DB_lookupProjectPath(id of theProject) of me
    logEvent("Processing project : " & theProjectName & " (" & theCounter & "/" & theCount & ")") of me
    tell application "Finder"
    if not (exists (POSIX file (theProjectPath & theProjectName) of me)) then
    logEvent("creating new folder " & theProjectName & " at " & theProjectPath) of me
    make new folder at (POSIX file theProjectPath of me) with properties {name:theProjectName}
    end if
    end tell
    if processOrder is equal to "projects" then
    set end of theProcessedProjects_G to (id of theProject)
    logEvent("Getting list of images...") of me
    set theImageList to every image version of project id (id of theProject) as list
    logEvent("Found " & (count of theImageList) & " images") of me
    set end of ProjectFolders to processImages(theImageList, (theProjectPath & theProjectName & "/"), "project", "JPEG - Original Size") of me as list
    end if
    logEvent("Getting list of subfolders...") of me
    set theSubfolderList to every subfolder of project id (id of theProject)
    logEvent("Found " & (count of theSubfolderList) & " subfolders") of me
    logEvent("Getting list of album...") of me
    set theAlbumList to every album of project id (id of theProject)
    logEvent("Found " & (count of theAlbumList) & " albums") of me
    if theSubfolderList is equal to {} then
    set end of ProjectFolders to processAlbums(theAlbumList, (theProjectPath & theProjectName & "/"), processOrder) of me as list
    else
    if theAlbumList is not equal to {} then
    set end of ProjectFolders to processAlbums(theAlbumList, (theProjectPath & theProjectName & "/"), processOrder) of me as list
    end if
    set end of ProjectFolders to processSubfolders(theSubfolderList, (theProjectPath & theProjectName & "/"), processOrder) of me as list
    end if
    if processOrder is equal to "projects" then
    cleanup(ProjectFolders, (theProjectPath & theProjectName & "/"), "all") of me
    else
    cleanup(ProjectFolders, (theProjectPath & theProjectName & "/"), "folder") of me
    end if
    end if
    set theCounter to theCounter + 1
    end repeat
    end tell
    logEvent("processProjects completed...") of me
    return arrayOfProjects
    end processProjects
    on exportImage(imageUUID, imageName, exportFolder, imageType, isAlbum, exportSettings, imageExt)
    set imageInfo to DB_lookupImageInfo(imageUUID) of me
    set imageTime to theImageDate of imageInfo as Unicode text
    set imageDate to date imageTime
    set isExported to 0
    set imageName to imageName & imageExt
    set theFile to POSIX file (exportFolder & imageName)
    tell application "Finder"
    set isUpdate to 0
    if not (exists theFile) then
    logEvent("Image does not exist in folder : " & exportFolder) of me
    set isUpdate to 1
    else
    logEvent("Get image modification date") of me
    do shell script "ls -l " & quoted form of (exportFolder & imageName)
    set imageFileDate to modification date of (info for theFile)
    if imageDate ≥ imageFileDate then
    logEvent("Image file date: " & imageFileDate as string) of me
    set isUpdate to 1
    end if
    end if
    if isUpdate = 1 then
    if exists theFile then
    move theFile to the trash
    end if
    if isAlbum is equal to "album" then
    logEvent("Creating a link for image: " & imageName) of me
    set theProjectFolder to theImagePath of imageInfo
    do shell script "ln " & quoted form of (theLibraryPath_G & theProjectFolder & "/" & imageName) & " " & quoted form of exportFolder
    else
    set isExported to 1
    logEvent("Exporting image: " & imageName) of me
    tell application "Aperture"
    if imageType is "master" then
    set settings to exportSettings
    export {image version id imageUUID} using settings to POSIX path of file exportFolder metadata embedded
    else
    set settings to exportSettings
    export {image version id imageUUID} using settings to POSIX path of file exportFolder metadata embedded
    end if
    end tell
    end if
    end if
    end tell
    return isExported
    end exportImage
    on DB_execute(SqlStatement)
    try
    set SqlScript to Sqlite_G & space & "-separator '|'" & space & (quoted form of ApertureLibrary_G) & space & (quoted form of SqlStatement) & " 2>&1"
    set SqlResult to do shell script SqlScript
    set theARray to {}
    set tid to AppleScript's text item delimiters
    set AppleScript's text item delimiters to ASCII character 13
    set SqlRecords to text items of SqlResult
    set AppleScript's text item delimiters to tid
    return SqlRecords
    on error s number i partial result p from f to t
    set s to "SQL Error: " & s
    logEvent(quoted form of (s)) of me
    end try
    end DB_execute
    on DB_record(SqlRecords, row, col)
    try
    set tid to AppleScript's text item delimiters
    set AppleScript's text item delimiters to "|"
    set SqlCols to text items of (item row of SqlRecords)
    set AppleScript's text item delimiters to tid
    return item col of SqlCols
    on error
    return {}
    end try
    end DB_record
    on DB_lookupRecord(SqlRecords, theReturnCol, theText, theCol)
    set theResult to ""
    repeat with theRow in items of SqlRecords
    set tid to AppleScript's text item delimiters
    set AppleScript's text item delimiters to "|"
    set theFields to text items of theRow
    set AppleScript's text item delimiters to tid
    if item theCol of theFields is equal to theText then
    set theResult to item theReturnCol of theFields
    exit repeat
    end if
    end repeat
    return theResult
    end DB_lookupRecord
    on processImages(theImageList, exportFolder, isAlbum, exportSettings)
    logEvent("processImages... : " & exportFolder) of me
    if exportSettings contains "JPEG" then
    set imageExt to ".jpg"
    else
    set imageExt to ".ANY"
    end if
    set arrayOfImages to {}
    with timeout of 6000 seconds
    set theCount to count of theImageList
    set theCounter to 1
    repeat with theImage in theImageList
    set imageUUID to id of theImage
    set imageName to name of theImage
    set end of arrayOfImages to imageName & imageExt
    logEvent("Processing image : " & imageName & " (" & theCounter & "/" & theCount & ")") of me
    set numExports_G to numExports_G + (exportImage(imageUUID, imageName, exportFolder, "version", isAlbum, exportSettings, imageExt) of me)
    set theCounter to theCounter + 1
    end repeat
    end timeout
    return arrayOfImages
    end processImages
    on processAlbums(theAlbumsList, theAlbumPath, processOrder)
    logEvent("processAlbums... : " & theAlbumPath) of me
    set arrayOfAlbums to {}
    tell application "Aperture"
    set theCount to count of theAlbumsList
    set theCounter to 1
    repeat with theAlbum in theAlbumsList
    set theAlbumName to name of theAlbum
    logEvent("Processing album : " & theAlbumName & " (" & theCounter & "/" & theCount & ")") of me
    set theCounter to theCounter + 1
    set AlbumObjects to {}
    set end of arrayOfAlbums to theAlbumName
    tell application "Finder"
    if not (exists (POSIX file (theAlbumPath & theAlbumName) of me)) then
    logEvent("creating new folder " & theAlbumName & " at " & theAlbumPath) of me
    make new folder at (POSIX file theAlbumPath of me) with properties {name:theAlbumName}
    end if
    end tell
    logEvent("Getting list of images...") of me
    set theImagesList to every image version of album id (id of theAlbum)
    logEvent("Found " & (count of theImagesList) & " images") of me
    if processOrder is equal to "albums" then
    set end of AlbumObjects to processImages(theImagesList, (theAlbumPath & theAlbumName & "/"), "album", "JPEG - Original Size") of me as list
    cleanup(AlbumObjects, (theAlbumPath & theAlbumName & "/"), "all") of me
    end if
    end repeat
    end tell
    logEvent("processAlbums completed...") of me
    return arrayOfAlbums
    end processAlbums
    on processSubfolders(theSubfoldersList, theSubfolderPath, processOrder)
    logEvent("processSubfolders... : " & theSubfolderPath) of me
    set arrayOfSubfolders to {}
    tell application "Aperture"
    set theCount to count of theSubfoldersList
    set theCounter to 1
    repeat with theSubfolder in theSubfoldersList
    set theSubfolderName to name of theSubfolder
    logEvent("Processing subfolder : " & theSubfolderName & " (" & theCounter & "/" & theCount & ")") of me
    set theCounter to theCounter + 1
    set end of arrayOfSubfolders to theSubfolderName
    tell application "Finder"
    if not (exists (POSIX file (theSubfolderPath & theSubfolderName) of me)) then
    logEvent("creating new folder " & theSubfolderName & " at " & theSubfolderPath) of me
    make new folder at (POSIX file theSubfolderPath of me) with properties {name:theSubfolderName}
    end if
    end tell
    set SubfoldersFolders to {}
    logEvent("Getting list of albums ...") of me
    set theAlbumsListOfSubfolder to every album of subfolder id (id of theSubfolder)
    logEvent("Found " & (count of theAlbumsListOfSubfolder) & " albums") of me
    logEvent("Getting list of subfolders...") of me
    set theSubfoldersListOfSubfolder to every subfolder of subfolder id (id of theSubfolder)
    logEvent("Found " & (count of theSubfoldersListOfSubfolder) & " subfolders") of me
    if theSubfoldersListOfSubfolder is equal to {} then
    set end of SubfoldersFolders to processAlbums(theAlbumsListOfSubfolder, (theSubfolderPath & theSubfolderName & "/"), processOrder) of me as list
    else
    if theAlbumsListOfSubfolder is not equal to {} then
    set end of SubfoldersFolders to processAlbums(theAlbumsListOfSubfolder, (theSubfolderPath & theSubfolderName & "/"), processOrder) of me as list
    end if
    set end of SubfoldersFolders to processSubfolders(theSubfoldersListOfSubfolder, (theSubfolderPath & theSubfolderName & "/"), processOrder) of me as list
    end if
    cleanup(SubfoldersFolders, (theSubfolderPath & theSubfolderName & "/"), "all") of me
    end repeat
    end tell
    logEvent("processSubfolders completed...") of me
    return arrayOfSubfolders
    end processSubfolders

    If you do externalize your Masters to folders anywhere (same drive, internal/external drive, multiple drives, whatever), never be tempted to use Finder to mess with them.
    As Frank said, use Relocate Masters.  Otherwise you'll confuse Aperture when it wakes up expecting Masters to be in certain places when they have moved elsewhere.
    It's possible to fix up the mess, but it's no fun!

  • How to create a folder (in unified folders) which contains all the messages of inboxes and outboxes

    Hi, i've searched without success how to create a folder (in unified folders) which contains all the messages of inboxes and outboxes (as it exists in Windows Live Mail).
    For me, it would be very useful to search in only one folder when i try to find something in sent and received mails.
    Thank's

    This is what Unified Folders does. I'm not sure what exactly you're trying to achieve.
    http://kb.mozillazine.org/Global_Inbox#Unified_Folders
    You might take a look at this article.
    https://support.mozilla.org/en-US/kb/global-search

  • Project Manager: Dealing with FOLDERS that contain audio?

    Hello everyone,
    I just started using Project Manager, and I'm in the process of reorganizing files. Upon examination, I've found I dont like the current location of some folders that contain audio files and would like to move them. I know its possible to "cut & paste" audio files into new places, but the manual says nothing about folders of audio and how to move them. Is there a way to do this in PM?
    Along the same lines, I dont like the names I have given to some folders and want to change them. Again, the manual shows how to change audio file names, but NOT folder names. I'm assuming folder names are just as important in searching databases correctly as file names, so is it possible to change these in PM?
    The only solution I've found to both problems is to create new folders in the finder and cut/past the audio files in PM? Seems kind of ridiculous to have to use two "programs" (finder & PM) just to move/rename folders, thus I wanted to check here first and make sure I'm doing it right. Is there another way
    Sorry for the stupid question. We now return you to your regularly scheduled programing...

    Hmmmm... this is one of those cans-of-worms situations... The PM has a "move" function, but judging by the menu choices, no "rename" function.
    If you went into an individual song and usde the "move audio file(s)" function in the audio window, you could create a new folder (with the name you want) when the file selector opens; then you've save (actually, move) the files into that new folder. Then, re-save your song/project.
    The downside to doing this is that other songs (previous versions, backups, etc.) will not find those audio files any longer (because the folder that originally contained those files is now empty). So Logic will invoke the search engine/project manager to find them.
    If the PM has been updated, this might not end up being a problem. But unless the names of those audio files have unique names, when you update PM, it will ask you which of the similarly-named files you want to choose to resolve the references for those other songs. It might mean that you spend a bit of time in front of the PM answering dialogs about it.
    I think you have to try this out to see if it works well or not.
    -=iS=-

  • A more efficient way to assure that a string value contains only numbers?

    Hi ,
    I'm using Oracle 9.2.0.6.
    I was curious to know if there was any way I could write a more efficient query to determine if a string value contains only numbers.
    Here's my current query. This SQL is from a sub query in a Join clause.
    select distinct cta.CUSTOMER_TRX_ID, to_number(cta.SALES_ORDER) SALES_ORDER
                from ra_customer_trx_lines_all cta
                where length(cta.SALES_ORDER) = 6
                and cta.SALES_ORDER is not null
                and substr(cta.SALES_ORDER,1,1) in('1','2','3','4','5','6','7','8','9','0')
                and substr(cta.SALES_ORDER,2,1) in('1','2','3','4','5','6','7','8','9','0')
                and substr(cta.SALES_ORDER,3,1) in('1','2','3','4','5','6','7','8','9','0')
                and substr(cta.SALES_ORDER,4,1) in('1','2','3','4','5','6','7','8','9','0')
                and substr(cta.SALES_ORDER,5,1) in('1','2','3','4','5','6','7','8','9','0')
                and substr(cta.SALES_ORDER,6,1) in('1','2','3','4','5','6','7','8','9','0')This is a string where I'm finding A-Z-a-z characters and '/' and '-' characters in all 6 positions, plus there are values that are longer than 6 characters. That's what the length(cta.SALES_ORDER) = 6 is for. Also, of course. some cells are NULL.
    So the question is, is there a more efficient way to screen out only the values in this field that are 6 character numbers or is what I have the best I can do?
    Thanks,

    I appreciate all of your very helpfull workarounds. The cost is a little better in all cases than my original where clause.
    To address the discussion that's popped up about design from this question, I can say a few things that should clear , at least, my situation up.
    First of all this custom quoting , purchase order , and sales order entry system WAS written by a bunch a of 'bad' coders who didn't document their work and then left. We don't even have an ER diagram
    The whole project that I'm only a small part of is literally trying to put Humpty Dumpty together again and then move it from a bad custom solution into Oracle Applications.
    We're rebuilding, documenting, and doing ETL. This is one of your prototypical projects from hell.
    It's a huge database project so we're taking small bites as a time. Hopefully, somewhere right before Armageddon hits, this thing will be complete.
    But until then,..., well,..., you know the drill.
    Thanks Again.

  • Adding wildcards to an existing find folders macro?

    I found Michael Bauer's excellent find folders script early last summer and applied it to my Outlook 2010 at that time.** It's been a godsend, most esp. since it also has ability to activate the found folder.  It's super great and I'd like to take that
    into sublime by adding wildcards to before and after the spot where the user input text would go.  I can't figure out in the code how that would go, however.
    This is the FindFolder portion where I suspect adding a "prefix" and a "suffix" wildcard would make the user's life easier.  I remember I always ran into trouble in an Access solution until I added just such a thing.  Then the
    user only needs to worry about adding the search term they're concerned with and it'll work (currently, typing in a search term yields zero results even when one knows the folder exists.  And there is also no error message.)
    Public Sub FindFolder()
    Dim Name$
    Dim Folders As Outlook.Folders
    Set m_Folder = Nothing
    m_Find = ""
    m_Wildcard = False
    ' Name = InputBox("Find Folder Name (you must use wildcards, this does not search for parts of a folder without them):", "Search Folder")
    Name = InputBox("Find Folder Name:", "Search Folder")
    If Len(Trim$(Name)) = 0 Then Exit Sub
    m_Find = Name
    m_Find = LCase$(m_Find)
    m_Find = Replace(m_Find, "%", "*")
    m_Wildcard = (InStr(m_Find, "*"))
    Set Folders = Application.Session.Folders
    LoopFINDfolders Folders
    If Not m_Folder Is Nothing Then
    If MsgBox("Activate Folder: " & vbCrLf & m_Folder.FolderPath, vbQuestion Or vbYesNo) = vbYes Then
    Set Application.ActiveExplorer.CurrentFolder = m_Folder
    End If
    Else
    MsgBox "Not Found", vbInformation
    End If
    End Sub
    Earlier today I added the text to alert user to add wildcards but it would be better to add it into the code itself.  I commented that particular line out and put the regular line back in.
    Also, besides adding a prefix and suffix wildcard, if I can call them that, would there be a way to also add wildcards in between words???  Can that be included?
    What I mean is that say the user typed this into the search box:
    fiscal year end activities
    that Outlook would then search for this, instead, successfully:
    *fiscal*year*end*activities*
    Thank you!  Very much appreciated.
    Cheers.
    ** (I have this as listed source URL, but it doesn't give his name.  But I now there are quite a few references to the macro as it's posted a lot as a solution: 
    http://www.vboffice.net/en/developers/find-folder-by-name/?mnu=2&cmd=showitem).

    Oh, um, thanks, Eugene <sigh>.
    Thanks for everyone's advice re learning vba.  I've been slowly learning over the years but I've really been there and done that with all those "learn vba"" sites I've ever looked at.  One gets bogged down so very quickly. 
    You have to sift through so much, you see, and weed out what is relevant and what is not.  I handle other more intuitive scripting and macro languages just fine, it's vb that just has something that makes it tough.  I also have a full time job that
    requires an hour to 3 of unpaid overtime every workday for me to keep up (they don't have enough staff).  And this all takes away from the time I do have (though this is that important).
    This is a macro that impacts me all the time.  I'm trying to find a way to find things fast and reliably as the "new" Outlook's features are not as strong as they used to be to either navigate quickly around Outlook or to find things quickly
    and reliably.  I just need to find out syntax to allow me to add a wildcard before and after where the user would input text.
    <sigh>
    Have a good day, everybody.  Going to have to leave this for now and to try to remember to add the wildcards in myself every time I use it.  Also, hopefully my next google searches for this will provide me with more information and if I'm very
    lucky, actual example syntax.  Well, it does happen sometimes though the searching takes a long time.
    Thank you.

  • Spotlight fails to find folders

    On a new iMac running 10.7.2 with two separate disks (SSD for Lion and apps and hard drive for user data) I have trouble to kick Spotlight into finding folders when searching by name. Spotlight indexed the hard drive twice but searches for folders by name for instance "lab" won't bring up any results, same for "lab folder" - only a search for "lab kind:folder" finally brings up the looked after folder. On a Macbook Air also running 10.7.2 I don't have this problem. What's wrong here? Is this a bug in Spotlight related to having user data on the secondary disk...?

    Same here. I'd think that this is a bug. Did you file a bug report?

  • Spotlight indexes and then doesn't find folders.  Need boolean folder search by name.

    I have re-indexed (via adding and removing from the list at " ▹ System Preferences ▹ Spotlight ▹ Privacy") an external HD twice, and still Spotlight fails to return positive hits on many Finder folders.  (I've even watched the indexing progress in the status bar that shows in the Spotlight HUD in Yosemite.)
    EasyFind, the free program from the makers of the DevonThink family of products, finds them.
    The external drive is formatted Mac OS Extended (Journaled).  I have used it for a few years.  Less than 1/5 full.  It is a FW800 drive connected via an Apple FW<—>Thunderbolt adapter.
    OS 10.10.  MacBook Pro (Retina, 15-inch, Early 2013).
    Suggestions?
    Bonus:  what I need to do is search and rename thousands of folders containing tens of thousands of files.  In order to do this efficiently, I need to perform boolean searches on folder names.  (These searches are straightforward:  "Contains X and Y; Contains X and not Y; and, if available, Starts with X and contains Y.)  EasyFind allows boolean searches of file _content_ but not (quizzically) file or folder names.  Suggestions?
    Thanks.
    —Kirby.

    (Sorry — could not figure out how to edit my OP.)
    I should have mentioned that both Spotlight and Finder's search have the exact same problem.  (As I understand the OS, this is expected, as Finder uses the Spotlight indices.)

  • IPhoto and Finder folders don't agree

    I have several albums in iPhoto that for some reason are different to the ones in my Home Finder folders. When I print (Canon PIxma) the printer always selects photos from the Finder and displays them on my desktop.
    How can I get my albums to show correctly in the Finder?

    Jack
    There are many, many ways to access your files in iPhoto:
    For 10.5 users: You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Apple-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. If you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto. With 10.5 you can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    Or, if you want to access the files with iPhoto not running, then create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    Regards
    TD

  • CWS not creating folders/subfolders in Plumtree

    Hi,
    We are in the process of developing CWS for LiveLink using EDK 5.0.2. We would like the crawler to be able to mirror Livelink's folder structure in Plumtree. But I believe due to Issue #21434 , the crawler cannot programmatically create the folder /sub-folders. We are able to crawl the documents that are in the folders/subfolders.Is there a programmatic work-around for this ?
    Thanks in advance.
    Mihir

    It's unnecessary to call back to the portal API for any of this information, and undesirable since it is relatively inefficient.
    First regarding mirroring: you should simply have each instance of you IContainer objects return the array of immediate child objects. Then, the portal user simply needs to select "mirror folder hierarchy" and the portal will automatically mirror your underlying folder structure.
    Secondly, regarding knowing the parent when getChildContainers is called: If you step back and look at how IContainerProvider and IContainer work together, this is easy:
    The portal will call IContainerProvider.AttachToContainer() for every folder/container, passing in the "containerLocation" of your parent (or current) folder. At this point, you usually will (and probably should) create a new instance of your IContainer class, passing the "containerLocation" on to the initializer method of IContainer. IContainer should save this value in an instance variable inside the object.
    Later on, the portal will call IContainer.getChildContainers() on this instance of IContainer. This method ought to look up the value of the instance variable and then use that to get access to the folder in the backend system. It should then be able to easily get a list of the immediate children of that folder, and return them in the array of ChildContainers.
    I don't know that much about Livelink, but the "containerLocation" will be some value that allows your code to easily look up and get access to the underlying container in the backend system. For example, it may be a path, or an inode number, or some other key like that.
    Anyway, once you understand how this works, you'll see that the portal then (eventually---exactly when and in what order is undefined) calls IContainerProvider.AttachToContainer() for each of the ChildContainers in the array, passing in the same "containerLocation" value as your code returned in the array, and the process continues recursively. (The very first top-level crawl gets its location from the crawler configuration, which is set by the user.)

  • How do I find file names containing special character

    hi all
    I need your help with a code that deals with finding file names containing special characters like * / \ : ? " |
    the reason is I am doing a project that transfer files and folders from Mac to Windows. But names containing above characters cant be moved to windows.
    the part of the code I write is like this
    set illegal_syntax to paragraphs of (do shell script "find " & quoted form of POSIX path of oneFolder & " -name '*'")
    if (illegal_syntax is not equal to {""}) then
    repeat with each_record in illegal_syntax
    do shell script "/usr/bin/ditto -c -k -rsrc --keepParent " & quoted form of each_record & space & quoted form of (each_record & ".zip")
    end repeat
    end if
    First of all that '' will gives me an error.
    Second, what i tried to do is once the file/folder is found, zip it at current location. But the problem is how can I zip it without the special character? or should I just give it a name, like "originalfile.zip";?
    Last, or maybe you have better idea to deal with this situation? BTW, I can not rename or delete the file/folder because customer won't allow me to do it.

    The backslash is used to escape characters in AppleScript, so if you want to use it in a string you need to escape the escape character, for example "\\*".
    You could set the name of the archive by replacing the illegal character with another one, such as an underscore:
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; border: 1px solid #000000; width: 720px; color: #000000; background-color: #FFDDFF; overflow: auto">set each_record to "some*file*name" -- example
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "*"}
    set the ItemList to text items of each_record
    set AppleScript's text item delimiters to "_"
    set each_record to the ItemList as text
    set AppleScript's text item delimiters to TempTID
    log each_record --> some_file_name
    </pre>

  • Where is option:  "Others.." when I try find folders or files ?

    Where is option: "Others.." when I try find folders or files ?

    Hello
    It's screenshot from Mac OS 10.4.11
    I don't use 10.4 so I cannot explore your issue on this Mac, sorry, because it does not appear as it does in your picture.
    My guess would be Others refers to other connected devices like, for example, an iDisk or a CD, some other 'thing' connected to your Mac. However the exact details I cannot know as it doesn't appear on my Mac.
    If this is just on the 10.4 Tiger OS then maybe repost your topic there, because I can only offer you a guess.
    http://discussions.apple.com/forum.jspa?forumID=751
    thank you

Maybe you are looking for

  • Uninstalled Old PS Versions - Now Get "One Or More File. . .etc" Error Message When Launching PS CC

    I just unistalled PS C3 through 6 on my computer leaving only PS CC for use going forward.  Having done this I now get this error message when launching PS CC:  "One or more files in the Adobe Application Support folder, necessary for running Photosh

  • Help!  OS 10.4.10 crashes our PowerMAC G5 from 10.4.6

    Here’s a rundown, sorry if a bit lengthy. I bought my wife an iPhone as a present a couple of days ago. She commences to activate it last night, but iTunes mentioned she needs the latest version. I don’t know what she had in the first place. But she

  • Error: Not Found Error: Out of Memory

    Hello, I'm trying to use a few photoshop files in Final Cut Pro 7.0.3 and I can't seem to shake these error messages. I've never had trouble using Photoshop files in the past but these ones are being uncooporative. I've imported the .psd file and edi

  • My problems about reload table

    hi guys, i hava some problems now ,but i think they are easy for u.i need your help,thanks. 1.in my mini application i save the data of JTable in txt format.i have a File menu,and the menuitems are New , Open ,Save ,Save As ,and exit.When i trigger t

  • Recommended way to read configuration

    Hie We have a system to fetch data from legacy system and push to bc4j. System is designed in a way that client can choose which classes to use for various phases involved in fetching. For example say system has a processData, validateData phae. So,