Hello.
I’m really puzzled.
I tried to use this script:
set targetDir to (path to desktop as text) & "resources Mojave:"
set guaranteed to targetDir & "Library:CoreServices:cloudphotosd.app:Contents:Frameworks:iCloudPhotoLibrary.framework:Versions:A:iCloudPhotoLibrary"
tell application "System Events"
set typeID to type identifier of disk item guaranteed
end tell
set quotedPOSIX to quoted form of (POSIX path of targetDir)
set thePaths to paragraphs of (do shell script "mdfind -onlyin " & quotedPOSIX & " kMDItemContentTypeTree == '" & typeID & "'")
{typeID, thePaths}
--> {"public.unix-executable", {}}
The targetDir is available on my SSD since 2020/01/04 at 17:28 so, as my iMac was continually ON since this creation, I assume that it’s indexed.
I removed several files but added none.
The Log History is :
Don't click [Open this Scriplet in your Editor:], here is a Log History
tell current application
path to desktop as text
--> "SSD 1000:Users:**********:Desktop:"
end tell
tell application "System Events"
get type identifier of disk item "SSD 1000:Users:**********:Desktop:resources Mojave:Library:CoreServices:cloudphotosd.app:Contents:Frameworks:iCloudPhotoLibrary.framework:Versions:A:iCloudPhotoLibrary"
--> "public.unix-executable"
end tell
tell current application
do shell script "mdfind -onlyin '/Users/**********/Desktop/resources Mojave/' kMDItemContentTypeTree == 'public.unix-executable'"
--> ""
end tell
Résultat :
{"public.unix-executable", {}}
What am I making wrongly to get this odd result ?
It’s odd because I am sure that the folder contain at least one ‘public.unix-executable’ file, the one referenced as guaranteed.
Must I understand that
-onlyin dir
Limit the scope of the search to the directory specified.
means that it doesn’t scan the subfolders embedded in the named folder ?
If it’s that, may I use mdfind to scan the full hierarchy of this folder?
I have an otherproblem with a similar script :
set targetDir to (path to desktop as text) & "puzzling:"
set guaranteed to targetDir & "iCloudPhotoLibrary"
tell application "System Events"
set typeID to type identifier of disk item guaranteed
end tell
set quotedPOSIX to quoted form of (POSIX path of targetDir)
set thePaths to paragraphs of (do shell script "mdfind -onlyin " & quotedPOSIX & " kMDItemContentTypeTree == '" & typeID & "'")
{typeID, thePaths}
--> {"public.symlink", {}}
Once again the shell script return an empty list but this time, the searched (and guaranteed) symlink is at the 1st level of the target directory.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 6 janvier 2020 15:37:56