FoxTrot Search Forum
FoxTrot Search for macOS Forum

Home » Public Forums » FoxTrot Search User Forum » is there a way to index files with extension .dart [one of google developing language]
is there a way to index files with extension .dart [one of google developing language] [message #861] Wed, 17 April 2019 08:00 Go to next message
Alex Fu
Messages: 3
Registered: April 2019
Junior Member
is there a way to index files with extension .dart [one of google
developing language]
thank you.
Re: is there a way to index files with extension .dart [one of google developing language] [message #862 is a reply to message #861] Wed, 17 April 2019 10:11 Go to previous messageGo to next message
FoxTrot Engineering
Messages: 384
Registered: April 2020
Senior Member
Alex Fu wrote:

> is there a way to index files with extension .dart [one of google
> developing language]
> thank you.

Yes; they are several ways to do so:

- install a Spotlight metadata importer (or an application that includes one) that handles this file type. As dart files are probably plain text files, this is probably not necessary though.

- install an application (e.g. an IDE or text editor) that declares the .dart file type as conforming to the UTI (Uniform Type Identifier) public.source-code or public.plain-text.

- in last resort, there is a command line setting in FoxTrot to make it index a specific file type as another one; first quit FoxTrot, then type the following command to a Terminal.app window:

defaults write com.ctmdev.foxtrot Aliases -array-add "{type='dart'; as='txt';}"

You will then have to rebuild your index.

See more FoxTrot hidden settings:
https://services.ctmdev.com/FoxTrot%20hidden%20preferences.h tml


Jérôme - CTM Engineering

--
------------------------------------------------------------ ---------
"If email is important to you, PowerMail should be important to you,
because I truly believe there isn’t a better one for the Macintosh."
PowerMail user comment on www.versiontracker.com


Download a demo version from www.ctmdev.com
------------------------------------------------------------ ---------

--

---


Jérôme - FoxTrot Engineering
Re: is there a way to index files with extension .dart [one of google developing language] [message #863 is a reply to message #862] Wed, 17 April 2019 18:10 Go to previous messageGo to next message
Alex Fu
Messages: 3
Registered: April 2019
Junior Member
>
> Thank you so much to help.


I have tried two of them, but foxtrot still does not index the .dart [plain
text] files. I guess the main cause is .dart extension is registered by mac
system as "DART disk image", so foxtrot does not index them,
please visit the follow link for .dart detail.
https://github.com/dart-lang/sdk/issues/28205 .dart files are treated as
disk images (security sensitive) on Macs
https://support.apple.com/kb/TA29157?locale=en_US&viewlo cale=en_US
I have tried:
1.in a Terminal.app window: defaults write com.ctmdev.foxtrot Aliases
-array-add "{type='dart'; as='txt';}"
2Iinstalled visual studio code change .dart file type to always open with
visual studio code.

I don't know how to write a Spotlight metadata importer for dart. and
.dart is a plain text file.
Would you please help me index .dart file thank you.
Re: is there a way to index files with extension .dart [one of google developing language] [message #864 is a reply to message #863] Wed, 17 April 2019 18:21 Go to previous messageGo to next message
Alex Fu
Messages: 3
Registered: April 2019
Junior Member
I find a solution to this:


Rebuilding the LaunchService database can be done by running a command in a
Terminal:

/System/Library/Frameworks/CoreServices.framework/Versions/A /Frameworks/LaunchServices.framework/Versions/A/Support/lsre gister
-kill -r -domain local -domain system -domain user

and then rebuild index.

for detail info:

https://github.com/dart-lang/sdk/issues/28205
Re: is there a way to index files with extension .dart [one of google developing language] [message #865 is a reply to message #864] Wed, 17 April 2019 19:25 Go to previous message
FoxTrot Engineering
Messages: 384
Registered: April 2020
Senior Member
Alex Fu wrote:

> I have tried:
> 1.in a Terminal.app window: defaults write com.ctmdev.foxtrot Aliases
> -array-add "{type='dart'; as='txt';}"

This should have worked. Make sure that:
- FoxTrot is not running when you enter the command
- the command is typed or pasted as a single line, followed by a return
- the FoxTrot index needs to be rebuilt afterwards

> 2Iinstalled visual studio code change .dart file type to always open with
> visual studio code.

Telling the Finder to open .dart files with a specific application is not enough; the application has to define the file extension in its info.plist file, and declare that it is a source code file; something like this:

UTExportedTypeDeclarations


UTTypeIdentifier
public.dart-source
UTTypeDescription
Dart source file
UTTypeConformsTo

public.source-code

UTTypeTagSpecification

public.filename-extension

dart





However, if this conflicts with a type declaration of another application (DiskImageMounter, in the case of dart, which associates the .dart extension to the com.apple.disk-image-dart UTI), then rebuilding the LaunchService database might be necessary, but I am not sure how this conflict will be arbitrated. Anyway, method 1 above should always work, independently of these LaunchServices considerations.

Additionally, there is yet another way to force some files to be indexed as plain text: set their HFS filetype to 'TEXT'. Kinda deprecated, but still working.

Jérôme - CTM Engineering

------------------------------------------------------------ ---------
"Try Foxtrot Personal Search... 1000 times better than spotlight
or GoogleDesktop. "
FoxTrot Personal Search user comment on http://emperor.tidbits.com

Download a demo version from www.foxtrot.ch
------------------------------------------------------------ ---------


Jérôme - FoxTrot Engineering
Previous Topic: Please answer my support inquiries!
Next Topic: Can we index epub?
Goto Forum:
  


Current Time: Fri Mar 29 14:20:12 GMT+1 2024