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.
Similar Messages
-
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 processSubfoldersIf 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! -
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.) -
How do I best integrate existing laptops for a new server? Can I use the existing home folders on the laptops and make them into Network Users?
Yes it will work. I've done it for a few users in my small office. As with anything, there are quirks that you may or may not experience. Most quirks are app-related, due to app developers hard-coding absolute paths into their apps for things like temp files (Photoshop). Strategies for resolving these sorts of quirks can be found via google. You would probably have seen these quirks already when using server-based home folders for your kids. If you haven't noticed them, then you're probably fine.
The tech note you cited should be fine. It doesn't explicitly say so, but you'll need to enable ssh on your server, at least temporarily, so you can upload your home folder to the server using scp, rsync, etc. Don't try to copy the files up to the server via Finder.
Once all your files are transferred to the server and in the right place, make sure to chown them on the server, so they are owned by the userID you created for yourself on the server.
As with anything this involved, make a good backup of your laptop first.
Note I have one user that isn't too happy with the responsiveness of the periodic mobile home syncing. She has about a decade of e-mail in her home folder, probably 50 to 100 emails per day, many with attachments. Mobile home syncing takes a long time to check and sync this huge tree of itty-bitty files, eevn with server-side file tracking turned on. The other users are happy.
The nice thing about mobile home syncing is that when a user "graduates" to an age where they've earned their own laptop, you can change them from a server home user to a mobile home user, with a minimum of fuss. Also, if you lose or break a laptop, you can add a new replacement laptop to your network, and pull-down a replica of the home folder from the server, with almost no downtime. -
Issue in adding Space to the existing Virtual Machine from added repository
Hi,
I'm facing issue in adding Space to the existing Virtual Machine (Guest OS) from added repository.
Environment details :
VM Server : /OVS => 130GB
/OVS/935970F2CC2D4B4391701397517F1001/ => 512 GB
Things I have done :
• I created a VM (Guest OS) in the VM Server with 120 GB
• After creating the VM (Guest OS) , When I tried adding a VIRTUAL DISK of size 150 GB , I got an error “Maximum available Disk space is only 10GB”.
My query :
• Will I be able to add space to Existing VM from the added Repository ( /OVS/935970F2CC2D4B4391701397517F1001/ ) , whose system.img is stored in path /OVS/running_pool/34_rhel/ .
Kindly help me out in this.
Thanks in advance.
-- SriHi all,
I checked with Oracle on the above and got the info currently , the we can utilise only the space available in the existing repo and cannot extend to additional repo.
Work around is : Clone it to the other repo , or Use Symbolic link .
Thanks,
Sri. -
I did not have this problem running the beta. I upgraded to the shipping version yesterday and whenever I try to move a file or application into another folder, both folders disappear, the desktop screen flashes, then I see the finder folders behind whatever application I had open last sitting on top of the finder window. If I let go of the mouse nothing moves and the windows close.
2013 MacBook Pro 13" retina, 10.10 shipping versionI'm having the same or similar issue... I think... trying to do a little house cleaning in the file structure. For example, in our events folder I'm creating archive folders (i.e. - 2004, 2005, ect...) and when I use the Files Panel to drag and drop the past event pages into the newly created archive folder, the pages loose all their links.
Image link prior to and after moving are the same (../images/logo1.gif)
It does ask me to confirm that I want to move the file but nothing about updating the links. Is it due to the way the files are linked in the original files?
Thanks in advance for any help!!! -
When you create a new bookmark by selecting the 'bookmark this page' command or clicking on the star next to the address, existing bookmark folders don't show up anywhere in the window. The only folder options are 'bookmarks toolbar', 'bookmarks menu' & 'unsorted bookmarks', non of which expand to show existing folders.
Try this extension:
Add Bookmark Here ² :
https://addons.mozilla.org/en-US/firefox/addon/3880 -
Install new OS, but use existing User folders
I'm going to buy a SSD for my Mac Pro. I would like to install a fresh OS on that drive, but use the existing User folders on my HD.
I assume there's an easy way to do this, but I *suspect* that the install will make default User folders and accounts?
Any advice?Maury Markowitz wrote:
I'm going to buy a SSD for my Mac Pro. I would like to install a fresh OS on that drive, but use the existing User folders on my HD.
I assume there's an easy way to do this, but I *suspect* that the install will make default User folders and accounts?
Any advice?
If you are the only user of your system you may be able to do this fairly easily. If there is more than one account it still may be be possible but there's a potential "gotcha".
If you intend to keep your home dir on a separate drive from your boot ssd, depending on how many of your own apps and data you intend to put on the ssd for faster access you really only need a 60GB to 120GB ssd. Assume the OS itself will need up to about 25GB of that ssd.
Assuming your are the only user then install the new OS on the ssd and create an account with the same account name of the one you had for the original system. Once that is up and running you can use the standard procedures to move an account to another drive. In other words use the Account system preferences to modify the account (account's Advanced Options) home dir info to point to your old home dir on the other drive. In this case you don't have any current home dir to actually move since you intend to use your old one on your other drive. Now reboot. Hopefully your reboot will come up using your old home dir.
The "gotcha" here is the userid. If you are the only user it should remain 501. So doing what I suggest above hopefully will work -- "hopefully" in that it has to be assumed your old account also had userid 501. With more than one account, if your old account wasn't 501 then I think you are in for ownership problems.
If you try this don't even attempt this without full backups of your original home disk(s). Best you create a bootable backup of your newly created ssd too so you don't have to reinstall and you can revert it from the backup if something goes wrong. Doing it this way doesn't write to new ssd cells if you don't have to (I am always concerend about this with ssd's even with possible TRIM or garbage collection). -
Once I connected my new server to my farm's config db, it returned all of the following missing locally. I stripped out any redundancies and Headings, and I'm left with 43. I'm looking for a efficient strategy. Should I start with the lowest version number
and work my way up? Current DB version is 14.0.7015.1000. IIRC, SP2 is cumulative, so can I ignore the first two (SP1 and Hotfix), install SP2, and then the Language packs and etc on top?
Sorted by version:
Microsoft SharePoint 2010 Service Pack 1 (SP1) (14.0.6029.1000)
Hotfix for Microsoft SharePoint Server 2010 (KB2775353) 64-Bit Edition (14.0.6105.5000)
Service Pack 2 for Microsoft SharePoint 2010 (KB2687453) 64-Bit Edition (14.0.7015.1000)
Service Pack 2 for Microsoft 2010 Server Language Pack (KB2687462) 64-Bit Edition (14.0.7015.1000)
Microsoft Office Server Proof (English) 2010 (14.0.7015.1000)
Microsoft Office Server Proof (French) 2010 (14.0.7015.1000)
Microsoft Office Server Proof (Russian) 2010 (14.0.7015.1000)
Microsoft Office Server Proof (Spanish) 2010 (14.0.7015.1000)
Microsoft SharePoint Portal (14.0.7015.1000)
Microsoft User Profiles (14.0.7015.1000)
Microsoft SharePoint Portal English Language Pack (14.0.7015.1000)
Microsoft Shared Components (14.0.7015.1000)
Microsoft Shared Coms English Language Pack (14.0.7015.1000)
Microsoft Slide Library (14.0.7015.1000)
Microsoft InfoPath Forms Services (14.0.7015.1000)
Microsoft InfoPath Form Services English Language Pack (14.0.7015.1000)
Microsoft Word Server (14.0.7015.1000)
Microsoft Word Server English Language Pack (14.0.7015.1000)
PerformancePoint Services for SharePoint (14.0.7015.1000)
PerformancePoint Services in SharePoint 1033 Language Pack (14.0.7015.1000)
Microsoft Visio Services English Language Pack (14.0.7015.1000)
Microsoft Visio Services Web Front End Components (14.0.7015.1000)
Microsoft Excel Services Components (14.0.7015.1000)
Microsoft Document Lifecycle Components (14.0.7015.1000)
Microsoft Excel Services English Language Pack (14.0.7015.1000)
Microsoft Search Server 2010 Core (14.0.7015.1000)
Microsoft Search Server 2010 English Language Pack (14.0.7015.1000)
Microsoft Document Lifecycle Components English Language Pack (14.0.7015.1000)
Microsoft Slide Library English Language Pack (14.0.7015.1000)
Microsoft SharePoint Server 2010 (14.0.7015.1000)
Microsoft Access Services Server (14.0.7015.1000)
Microsoft Access Services English Language Pack (14.0.7015.1000)
Microsoft Web Analytics Web Front End Components (14.0.7015.1000)
Microsoft Web Analytics English Language Pack (14.0.7015.1000)
Microsoft Excel Mobile Viewer Components (14.0.7015.1000)
Recommendations?
Thanks,
ScottThanks guys. I was able to get through all of the patches except for
Language Pack for SharePoint, Project Server and Office Web Apps 2010 - English missing locally
Language Pack for SharePoint, Project Server and Office Web Apps 2010 -
Spanish/Español missing locally
This was my process:
Config Wizard:
Adding Index server to existing farm, "Server Farm Product and Patch Status" returned 34 Missing Locally required products and patches.
SKIP installing the following two, as SP2 is cumulative
Microsoft SharePoint 2010 Service Pack 1 (SP1) (14.0.6029.1000) (officeserver2010sp1-kb2460045-x64-fullfile-en-us.exe)
Hotfix for Microsoft SharePoint Server 2010 (KB2775353) 64-Bit Edition (14.0.6105.5000)
install SP2 oserversp2010-kb2687453-fullfile-x64-en-us.exe
install oslpksp2010-kb2687462-fullfile-x64-en-us.exe
Got "There are no products affected by this package installed on this system."
SO!
Uninstalled Sharepoint 2010 Server
WIll try to install again, without skipping #2, and reorder installation of oslpksp2010-kb2687462-fullfile-x64-en-us.exe
Retry (the long way):
Run SharePointServer.exe, get Missing Locally...
Install oslpksp2010-kb2687462-fullfile-x64-en-us.exe SUCCESSFUL
Install officeserver2010sp1-kb2460045-x64-fullfile-en-us.exe SUCCESSFUL
Reboot
Install oserversp2010-kb2687453-fullfile-x64-en-us.exe SUCCESSFUL
Rerun Config
STILL MISSING
Download oslpksp2010-kb2687462-fullfile-x64-es-es.exe, run, "there are no products affected..."
Uninstall.
Re-retried, only got through the first couple:
Run SharePointServer.exe, get Missing Locally...
Install SP1 officeserver2010sp1-kb2460045-x64-fullfile-en-us.exe, SUCCESSFUL
Install English Lang Pack oslpksp2010-kb2687462-fullfile-x64-en-us.exe, "There are no products affected by this package installed on this system."
Install Spanish Lang Pack oslpksp2010-kb2687462-fullfile-x64-es-es.exe,
Install SP2 oserversp2010-kb2687453-fullfile-x64-en-us.exe, run Config Wizard
I'm now downloading 462150_intl_x64_zip.exe, going to try and install it as step three.
Any suggestions greatly appreciated.
Thanks,
Scott -
Remove existing share folders in windows domain client machines
Hi Team,
I used sysinternals tool shareenum & found in our Windows domain network many users have shared folders in their local machine which is highlighted by auditor. Now i have found a way through GP to block Filesharing but how can i remove existing shared
folders from all windows client machines.
Please help.This is Exchange 2010 forum, suggest you to post this in Windows forum to get faster responses...
http://social.technet.microsoft.com/Forums/windowsserver/en-US/home
Blog |
Get Your Exchange Powershell Tip of the Day from here -
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?
-
InDesign CC 2014 version adding pages to an existing document keeps crashing, why?
InDesign CC 2014 version adding pages to an existing document keeps crashing, why?
Because there's a problem in the file. See Remove minor corruption by exporting
-
Adding portal to an existing domain
Hi I have a JSP/Servlet web applicatin and
I want to make it a portal application.
I was following Weblogic Portal Development
Guide 7.0. I found the section
"Adding portal to an existing domain" is very incomplete
or confusing and I cannot do it. Is there any better document
for this?Judging from the dates between these two entrries and no answers, I'd
guess that there isn't anyone from BEA monitoring this group? I am in a
similar situation. What I want to understand is how one can "portalize" an
existing web app. I understand there are implications to some of the
presentation, but specifically, I want to deploy a Servlet based app that
uses EJBs and deploy this as an EAR in the same domain as the portal
(perhaps under the /applications directory). I can make everything work
except the webflow where I reference the Servlet.
Specifically, I have a presentation page that is defined to be my servlet.
When I try to build a webflow URL referencing this event, I get errors from
the portal because it presumes it may be located somewhere else or in a
different namespace. It leads me to believe that I can't reference a
servlet unless it is under the /framework or /portal directories under the
portal web-app directory. I'm convinced there must be a way to reference
other web components that aren't specifically part of the portal web app,
but can't figure out how to propagate the webflow element to the actual
servlet I want.
Any ideas from the community at large? This must be something other
people have wrestled with since I can't imagine that only new apps will be
put into portals.
Thanks,
Mark
"Sara" <[email protected]> wrote in message
news:[email protected]...
>
I'm facing similar problems too. I have an ear file in an existing domainthat
I want to use to create a portal. The documentation on this is quiteconfusing
and the steps require so many manual steps that it is bound to beerror-prone.
What's BEA's recommended way to expose an existing Weblogic application asa portal
Thanks in advance
-Sara
"David Zhang" <[email protected]> wrote:
Hi I have a JSP/Servlet web applicatin and
I want to make it a portal application.
I was following Weblogic Portal Development
Guide 7.0. I found the section
"Adding portal to an existing domain" is very incomplete
or confusing and I cannot do it. Is there any better document
for this? -
Adding replication to an existing database.
I am looking at adding replication to an existing database. This database has lots of existing containers many of them are 1G in size. How will this be handled when the master and client initially start? Will the master just start sending to the client? Is there another option?
Yes. This, and the alternatives, are described in the Ref Guide, on the page entitled "Initializing a new site".
Alan Bram
Oracle -
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
Maybe you are looking for
-
Netbeans Java Desktop Application Problem
Hi I have build a java desktop application via netbeans and it creates a jnlp file to execute this applets however in my project when i press a button on an applet it opens another applet and send some parameter via html file how can i do that in des
-
How can I add a variable that will always be relevant to a decision report?
I would like to add assessment date and assessment notes to a decision report, such that these two variables are always displayed (always relevant), regardless of whether the overall conclusion is true or false. What would be the best way to do this?
-
Switching from Sony Sonicstage to iTunes
Does anyone know the possibility of switching my 12,000 OpenMG formatted songs into iTunes? I had Sony - now am switching to Apple.
-
TS1424 Trying to download the new StarTrek film and get error 8008
Trying to download the new StarTrek film and get error 8008. This is on paid and rent!
-
How do I fix this browser incompatability?
This is my first web site with DW. and I have it finished...but...when I used the browser compatability check , I came up with an erro in line 32 dealing with spry menu bar that affects 8 browsers. I don't know how to correct it since I use design vi