nikivi Posted November 6, 2018 Share Posted November 6, 2018 (edited) I have this workflow that is a file filter that should only search folders However it recently started showing me not only folders but JS files too. Is this a known bug? Anything I can do to solve this? Thank you. Edited November 6, 2018 by nikivi Link to comment
Vero Posted November 6, 2018 Share Posted November 6, 2018 Hi @nikivi Step one is to rebuild your Mac's index, since if the metadata isn't correct or complete, this may occur. Cheers, Vero Link to comment
nikivi Posted November 6, 2018 Author Share Posted November 6, 2018 5 hours ago, Vero said: Step one is to rebuild your Mac's index Doing that now. One thing I want to note is that when I ticked this box: When it tried to rm it, terminal said `permission denied` even though I wrote my sudo password. Perhaps that's due to SIP. Maybe it's something that should be noted? Link to comment
nikivi Posted November 6, 2018 Author Share Posted November 6, 2018 Finished rebuilding the index. I still have JS files shown when it should only show Folders. Anything I can do aside from rebuilding the index to fix this? Link to comment
Vero Posted November 6, 2018 Share Posted November 6, 2018 @nikivi Grab the Alfred Metadata tool here and drag some of your .ts and .js files to work out what their file types are: https://cachefly.alfredapp.com/tools/AlfredMetadataTool_v1.1.zip Paste the results so we can see what file types are listed in the metadata, and whether that's why they're returned. Next, copy just the File Filter object from your workflow, set a new keyword, and try using just that object (let's say, with a Reveal in Finder action added to the end)? Removing all your scripts that surrounds it will ensure results down to exclusively what the File Filter is returning, rather than anything that's then passed through scripts. Cheers, Vero Link to comment
nikivi Posted November 6, 2018 Author Share Posted November 6, 2018 A JS file /Users/nikivi/src/orgs/learn-anything/learn-anything/frontend/node_modules/bs-platform/lib/amdjs/unix.js Internal File Metadata ====================== Display Name: unix.js Alt Names: File Type: public.folder Comments: Keywords: Last Used: Raw mdls File Metadata ====================== kMDItemContentCreationDate = 2018-11-06 00:46:11 +0000 kMDItemContentCreationDate_Ranking = 2018-11-06 00:00:00 +0000 kMDItemContentModificationDate = 2018-11-06 00:46:11 +0000 kMDItemContentType = "public.folder" kMDItemContentTypeTree = ( "public.item", "public.folder", "public.directory" ) kMDItemDateAdded = 2018-11-06 00:46:11 +0000 kMDItemDateAdded_Ranking = 2018-11-06 00:00:00 +0000 kMDItemDisplayName = "unix.js" kMDItemFSContentChangeDate = 2018-11-06 00:46:11 +0000 kMDItemFSCreationDate = 2018-11-06 00:46:11 +0000 kMDItemFSCreatorCode = "" kMDItemFSFinderFlags = 0 kMDItemFSHasCustomIcon = (null) kMDItemFSInvisible = 0 kMDItemFSIsExtensionHidden = 0 kMDItemFSIsStationery = (null) kMDItemFSLabel = 0 kMDItemFSName = "unix.js" kMDItemFSNodeCount = (null) kMDItemFSOwnerGroupID = 20 kMDItemFSOwnerUserID = 501 kMDItemFSSize = 59031 kMDItemFSTypeCode = "" kMDItemInterestingDate_Ranking = 2018-11-06 00:00:00 +0000 kMDItemKind = "Folder" kMDItemLogicalSize = 59031 kMDItemPhysicalSize = 61440 Link to comment
nikivi Posted November 6, 2018 Author Share Posted November 6, 2018 (edited) Copying file filter also searches not just folders but other files Edited November 6, 2018 by nikivi Link to comment
nikivi Posted November 6, 2018 Author Share Posted November 6, 2018 The file filter does specify to search only folders Thank you for any help on solving this. Link to comment
deanishe Posted November 6, 2018 Share Posted November 6, 2018 (edited) 6 hours ago, nikivi said: A JS file /Users/nikivi/src/orgs/learn-anything/learn-anything/frontend/node_modules/bs-platform/lib/amdjs/unix.js Internal File Metadata ====================== Display Name: unix.js Alt Names: File Type: public.folder Anything look funny to you, Niki? Edited November 7, 2018 by deanishe Remove excess space nikivi 1 Link to comment
nikivi Posted November 6, 2018 Author Share Posted November 6, 2018 Oh wow. How can a JS file be of this type? ? Not sure what I can do. Perhaps my system is messed up and I need to reformat my drive. Don’t really want to do that. Link to comment
deanishe Posted November 6, 2018 Share Posted November 6, 2018 You could try using lsregister to re-register an app that defines JavaScript files. That might fix the screwed-up assignment of the .js extension to public.folder. Link to comment
nikivi Posted November 7, 2018 Author Share Posted November 7, 2018 3 hours ago, deanishe said: could try using lsregister to re-register an app that defines JavaScript files Forgive me for perhaps a silly question but I read through that document few times and I don't get how do I find what app defines JavaScript files? Is it the app that is set to default open the file type? So in my case I'd run: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -u /Applications/Visual\ Studio\ Code.app Link to comment
deanishe Posted November 7, 2018 Share Posted November 7, 2018 (edited) 15 minutes ago, nikivi said: I don't get how do I find what app defines JavaScript files? My system shows JS files as having the UTI com.netscape.javascript-source. So you should grep your /Applications directory for com.netscape.javascript-source to see which app defines that UTI. On my machine, that would be BBEdit, VimR, VoodooPad and TextMate. Installing (and running) one of those apps might also fix your problem. VS Code supports .js files, but it doesn't define a UTI for them, so that likely won't work. (This stuff is all defined in an app's info.plist.) Edited November 7, 2018 by deanishe nikivi 1 Link to comment
nikivi Posted November 7, 2018 Author Share Posted November 7, 2018 I got this (rg is ripgrep). /Applications ❯ rg com.netscape.javascript-source Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/Frameworks/DevToolsCore.framework/Versions/A/Resources/StandardFileTypes.xcspec 381: UTI = "com.netscape.javascript-source"; Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreServices.framework/Headers/UTCoreTypes.h 464: * UTI: com.netscape.javascript-source 525: * com.netscape.javascript-source Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/System/Library/Frameworks/CoreServices.framework/Headers/UTCoreTypes.h 464: * UTI: com.netscape.javascript-source 525: * com.netscape.javascript-source Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreServices.framework/Headers/UTCoreTypes.h 464: * UTI: com.netscape.javascript-source 525: * com.netscape.javascript-source Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreServices.framework/Headers/UTCoreTypes.h 464: * UTI: com.netscape.javascript-source 525: * com.netscape.javascript-source Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreServices.framework/Headers/UTCoreTypes.h 464: * UTI: com.netscape.javascript-source 525: * com.netscape.javascript-source Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/System/Library/Frameworks/CoreServices.framework/Headers/UTCoreTypes.h 464: * UTI: com.netscape.javascript-source 525: * com.netscape.javascript-source Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Headers/UTCoreTypes.h 464: * UTI: com.netscape.javascript-source 525: * com.netscape.javascript-source ``` Neither of these are apps it seems. Going to install BBEdit and open .js file .d.ts and .ts files and hope that fixes it. Link to comment
nikivi Posted November 7, 2018 Author Share Posted November 7, 2018 5 minutes ago, nikivi said: Going to install BBEdit and open .js file .d.ts and .ts files and hope that fixes it. Didn't work. ? Link to comment
deanishe Posted November 7, 2018 Share Posted November 7, 2018 Try re-registering BBEdit with lsregister. Perhaps nuke the whole database. Link to comment
nikivi Posted November 7, 2018 Author Share Posted November 7, 2018 (edited) 10 minutes ago, deanishe said: Try re-registering BBEdit with lsregister Tried that. Didn't help. 10 minutes ago, deanishe said: Perhaps nuke the whole database I don't have LaunchServices.framework in Frameworks so I can't run the mentioned in that article command. I can try run: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user But I want to make sure that it would do the same thing. Is it safe to run? Edited November 7, 2018 by nikivi Link to comment
deanishe Posted November 7, 2018 Share Posted November 7, 2018 2 minutes ago, nikivi said: But I want to make sure that it would do the same thing. Of course it's the same thing.That's an old article. Things move around. Link to comment
nikivi Posted November 7, 2018 Author Share Posted November 7, 2018 Ran the above command. File types of JS,TS/.d.ts are still public.folder Link to comment
nikivi Posted November 7, 2018 Author Share Posted November 7, 2018 Restarting mac didn't work too ? Link to comment
nikivi Posted November 8, 2018 Author Share Posted November 8, 2018 Anyone knows what else one can do to try fix this? Link to comment
dfay Posted November 8, 2018 Share Posted November 8, 2018 use the instructions linked here to rebuild LS Link to comment
nikivi Posted November 8, 2018 Author Share Posted November 8, 2018 (edited) 5 hours ago, dfay said: use the instructions linked here to rebuild LS Didn't help sadly: The file types are all still public.folder. /Users/nikivi/src/orgs/learn-anything/learn-anything/frontend/node_modules/reason-apollo/lib/bs/src/ApolloClient.mlast.d Internal File Metadata ====================== Display Name: ApolloClient.mlast.d Alt Names: File Type: public.folder Comments: Keywords: Last Used: Raw mdls File Metadata ====================== Is the only other solution to format my disk? Edited November 8, 2018 by nikivi Link to comment
dfay Posted November 8, 2018 Share Posted November 8, 2018 weird. But would a reformat not bring the issue back when you restore the files? Link to comment
Andrew Posted November 9, 2018 Share Posted November 9, 2018 It could be that one of the apps that you have installed is defining that JS files to be of type public folder, and even rebuilding the launch services database won't fix things because of whichever app this is. The first answer on here gives more info to save me typing more about this: https://superuser.com/questions/263311/on-os-x-how-do-you-change-a-files-kind If you could work out which app it is and delete that app, you may have more luck when trying to re-associate these files. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now