I am looking for a way to launch Finder and highlight a file.
FolderItemDirectory.Child(“filename”).launch but this does nothing
FolderItemDirectory.Child(“filename”).parent.launch opens and highlights the parent directory
please advise.
I am looking for a way to launch Finder and highlight a file.
FolderItemDirectory.Child(“filename”).launch but this does nothing
FolderItemDirectory.Child(“filename”).parent.launch opens and highlights the parent directory
please advise.
And if you have a new question, let us know what OS…
[quote=374403:@Antonio Rinaldi]Maybe you can use the function in this post
it’s in Italian but you can easily use it[/quote]
The topic that Axel referenced contains the proper declares to do this and does not rely on the SHELL
and as how he specified FINDER, one should rightfully assume it is needed for macOS
[quote=374403:@Antonio Rinaldi]Maybe you can use the function in this post
it’s in Italian but you can easily use it[/quote]
Lennox
Sorry everyone, this question is for MACOS
Declare Function objc_getClass Lib "libobjc.dylib" ( name As CString ) As ptr
Declare Function sharedWorkspace Lib "AppKit" selector "sharedWorkspace" ( obj As ptr ) As ptr
Declare Function selectFile Lib "AppKit" selector "selectFile:inFileViewerRootedAtPath:" ( obj As ptr, fPath As CFStringRef, rootFullPath As CFStringRef ) As Boolean
Dim workspace As ptr = sharedWorkspace( objc_getClass( "NSWorkspace" ) )
// assert ( workspace <> nil, CurrentMethodName + " is Nil")
Call selectFile( workspace, f.Nativepath, "")
Axel
it does work good,
Thank you all.